diff --git a/.ci-env.sh b/.ci-env.sh index a6c977f6..6a732648 100644 --- a/.ci-env.sh +++ b/.ci-env.sh @@ -1,175 +1,10 @@ +#!/bin/bash # Use the develop branch for WPCS for compatibility with PHPCS 2.0 export WPCS_GIT_TREE=develop -# Set up for the PHPUnit pass. -setup-phpunit() { - - if [[ $TRAVIS_PHP_VERSION == '5.2' ]]; then - mkdir -p vendor/jdgrimes/wp-plugin-uninstall-tester - curl -L https://github.com/JDGrimes/wp-plugin-uninstall-tester/archive/master.tar.gz \ - | tar xvz --strip-components=1 -C vendor/jdgrimes/wp-plugin-uninstall-tester - elif [[ $TRAVIS_PHP_VERSION == hhvm ]]; then - composer require satooshi/php-coveralls:dev-master - mkdir -p build/logs - else - composer install - fi - - wget -O /tmp/install-wp-tests.sh \ - https://raw.githubusercontent.com/wp-cli/wp-cli/master/templates/install-wp-tests.sh - - sed -i 's/$WP_VERSION == '"'"'latest'"'"'/$WP_VERSION == '"'"'stable'"'"'/' \ - /tmp/install-wp-tests.sh - - bash /tmp/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION - - sed -i 's/do_action( '"'"'admin_init'"'"' )/if ( ! isset( $GLOBALS['"'"'_did_admin_init'"'"'] ) \&\& $GLOBALS['"'"'_did_admin_init'"'"'] = true ) do_action( '"'"'admin_init'"'"' )/' \ - /tmp/wordpress-tests/includes/testcase-ajax.php - - cd /tmp/wordpress/wp-content/plugins - ln -s $PLUGIN_DIR $PLUGIN_SLUG - cd $PLUGIN_DIR -} - -# Set up for the codesniff pass. -setup-codesniff() { - - mkdir -p $PHPCS_DIR && curl -L \ - https://github.com/$PHPCS_GITHUB_SRC/archive/$PHPCS_GIT_TREE.tar.gz \ - | tar xvz --strip-components=1 -C $PHPCS_DIR - - mkdir -p $WPCS_DIR && curl -L \ - https://github.com/$WPCS_GITHUB_SRC/archive/$WPCS_GIT_TREE.tar.gz \ - | tar xvz --strip-components=1 -C $WPCS_DIR - - $PHPCS_DIR/scripts/phpcs --config-set installed_paths $WPCS_DIR - - npm install -g jshint - - composer install -} - -# Check php files for syntax errors. -codesniff-php-syntax() { - if [[ $TRAVISCI_RUN == codesniff ]] || [[ $TRAVISCI_RUN == phpunit && $WP_VERSION == stable && $TRAVIS_PHP_VERSION != '5.3' ]]; then - find . ! -path "./dev-lib/*" ! -path "./vendor/*" \( -name '*.php' -o -name '*.inc' \) \ - -exec php -lf {} \; - else - echo 'Not running PHP syntax check.' - fi -} - -# Check php files with PHPCodeSniffer. -codesniff-phpcs() { - if [[ $TRAVISCI_RUN == codesniff ]]; then - $PHPCS_DIR/scripts/phpcs -ns --standard=$WPCS_STANDARD \ - $(if [ -n "$PHPCS_IGNORE" ]; then echo --ignore=$PHPCS_IGNORE; fi) \ - $(find . -name '*.php') - else - echo 'Not running PHPCS.' - fi -} - -# Check JS files with jshint. -codesniff-jshint() { - if [[ $TRAVISCI_RUN == codesniff ]]; then - jshint . - else - echo 'Not running jshint.' - fi -} - -# Check PHP files for proper localization. -codesniff-l10n() { - if [[ $TRAVISCI_RUN == codesniff ]]; then - ./vendor/jdgrimes/wp-l10n-validator/bin/wp-l10n-validator - else - echo 'Not running wp-l10n-validator.' - fi -} - -# Check XML files for syntax errors. -codesniff-xmllint() { - if [[ $TRAVISCI_RUN == codesniff ]]; then - xmllint --noout $(find . ! -path "./dev-lib/*" ! -path "./vendor/*" \( -name '*.xml' -o -name '*.xml.dist' \)) - else - echo 'Not running xmlint.' - fi -} - -# Run basic PHPUnit tests. -phpunit-basic() { - if [[ $TRAVISCI_RUN != phpunit ]]; then - echo 'Not running PHPUnit.' - return - fi - - local TEST_GROUP=${1-''} - local CLOVER_FILE=${2-basic} - - local GROUP_OPTION='' - local COVERAGE_OPTION='' - - if [[ $WP_VERSION == '3.8' && $TEST_GROUP == ajax && $WP_MULTISITE == 1 ]]; then - echo 'Not running multisite Ajax tests on 3.8, see https://github.com/WordPoints/wordpoints/issues/239.' - return - fi - - if [[ $TEST_GROUP != '' ]]; then - GROUP_OPTION="--group=$TEST_GROUP" - CLOVER_FILE+="-$TEST_GROUP" - - if [[ $TRAVIS_PHP_VERSION == '5.2' ]]; then - sed -i '' -e "s/$TEST_GROUP<\/group>//" ./phpunit.xml.dist - fi - fi - - if [[ $TRAVIS_PHP_VERSION == hhvm ]]; then - COVERAGE_OPTION="--coverage-clover build/logs/clover-$CLOVER_FILE.xml" - fi - - phpunit $GROUP_OPTION $COVERAGE_OPTION -} - -# Run uninstall PHPUnit tests. -phpunit-uninstall() { - phpunit-basic uninstall -} - -# Run Ajax PHPUnit tests. -phpunit-ajax() { - phpunit-basic ajax -} - -# Run the basic tests on multisite. -phpunit-ms() { - WP_MULTISITE=1 phpunit-basic '' ms -} - -# Run the uninstall tests on multisite. -phpunit-ms-uninstall() { - WP_MULTISITE=1 phpunit-basic uninstall ms -} - -# Run the ajax tests on multisite. -phpunit-ms-ajax() { - WP_MULTISITE=1 phpunit-basic ajax ms -} - -# Run basic tests for multisite in network mode. -phpunit-ms-network() { - WORDPOINTS_NETWORK_ACTIVE=1 WP_MULTISITE=1 phpunit-basic '' ms-network -} - -# Run uninstall tests in multisite in network mode. -phpunit-ms-network-uninstall() { - WORDPOINTS_NETWORK_ACTIVE=1 WP_MULTISITE=1 phpunit-basic uninstall ms-network -} - -# Run Ajax tests in multisite in network mode. -phpunit-ms-network-ajax() { - WORDPOINTS_NETWORK_ACTIVE=1 WP_MULTISITE=1 phpunit-basic ajax ms-network -} +# Ignore the WordPress dev lib when codesniffing. +CODESNIFF_PATH+=('!' -path "./dev-lib/*") +export CODESNIFF_PATH # EOF diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index 46e4bf20..00000000 --- a/.coveralls.yml +++ /dev/null @@ -1,2 +0,0 @@ -src_dir: src -coverage_clover: build/logs/clover-*.xml \ No newline at end of file diff --git a/.coveralls.yml b/.coveralls.yml new file mode 120000 index 00000000..6ccd07fa --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1 @@ +dev-lib-wordpoints/travis/.coveralls.yml \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 431ecf16..29c313e5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "dev-lib"] path = dev-lib url = https://github.com/xwp/wp-dev-lib.git +[submodule "dev-lib-wordpoints"] + path = dev-lib-wordpoints + url = https://github.com/WordPoints/dev-lib.git diff --git a/.travis.yml b/.travis.yml index f07e525c..21ec002d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# Travis CI configuration file. +# Travis CI configuration file for WordPoints. language: php @@ -12,11 +12,10 @@ php: env: - TRAVISCI_RUN=codesniff + - TRAVISCI_RUN=phpunit WP_VERSION=nightly - TRAVISCI_RUN=phpunit WP_VERSION=latest - - TRAVISCI_RUN=phpunit WP_VERSION=stable - TRAVISCI_RUN=phpunit WP_VERSION=4.0 - TRAVISCI_RUN=phpunit WP_VERSION=3.9 - - TRAVISCI_RUN=phpunit WP_VERSION=3.8 sudo: false @@ -24,7 +23,7 @@ matrix: include: # Only run HHVM against the latest for now. - php: hhvm - env: TRAVISCI_RUN=phpunit WP_VERSION=stable + env: TRAVISCI_RUN=phpunit WP_VERSION=latest exclude: # The codesniff pass only needs to be run once, I chose PHP 5.3, since WPCS requires it. - php: 5.2 @@ -39,29 +38,10 @@ matrix: - php: hhvm fast_finish: true -before_install: - - export WP_TESTS_DIR=/tmp/wordpress-tests/ - - export PLUGIN_DIR=$(pwd) - - export PLUGIN_SLUG=$(basename $(pwd) | sed 's/^wp-//') - - export PHPCS_DIR=/tmp/phpcs - - export PHPCS_GITHUB_SRC=squizlabs/PHP_CodeSniffer - - export PHPCS_GIT_TREE=master - - export PHPCS_IGNORE='vendor/*,dev-lib/*' - - export WPCS_DIR=/tmp/wpcs - - export WPCS_GITHUB_SRC=WordPress-Coding-Standards/WordPress-Coding-Standards - - export WPCS_GIT_TREE=master - - export WPCS_STANDARD=$(if [ -e phpcs.ruleset.xml ]; then echo phpcs.ruleset.xml; else echo WordPress; fi) - - if [ -e .ci-env.sh ]; then source .ci-env.sh; fi - before_script: - - > - if [ $TRAVISCI_RUN == phpunit ]; then - setup-phpunit - fi - - > - if [ $TRAVISCI_RUN == codesniff ]; then - setup-codesniff - fi + - export WORDPOINTS_PROJECT_TYPE=wordpoints + - export DEV_LIB_PATH=dev-lib-wordpoints + - source $DEV_LIB_PATH/travis/before_script.sh script: - codesniff-php-syntax @@ -69,6 +49,7 @@ script: - codesniff-jshint - codesniff-l10n - codesniff-xmllint + - codesniff-bash - phpunit-basic - phpunit-ms - phpunit-ms-network @@ -80,4 +61,4 @@ script: - phpunit-ms-network-ajax after_script: - - if [[ $TRAVIS_PHP_VERSION == hhvm ]]; then php vendor/bin/coveralls; fi + - source $DEV_LIB_PATH/travis/after_script.sh diff --git a/assets/banner-772X250.png b/assets/banner-772x250.png similarity index 100% rename from assets/banner-772X250.png rename to assets/banner-772x250.png diff --git a/composer.json b/composer.json index 680a9555..9dbd3cad 100644 --- a/composer.json +++ b/composer.json @@ -3,8 +3,6 @@ "php": ">=5.2.0" }, "require-dev": { - "jdgrimes/wp-plugin-uninstall-tester": "~0.4", - "jdgrimes/wp-l10n-validator": "dev-master", - "wordpoints/l10n-validator-config": "~1.0" + "jdgrimes/wp-plugin-uninstall-tester": "~0.4" } } \ No newline at end of file diff --git a/composer.lock b/composer.lock index 0b6d6126..c431d39a 100644 --- a/composer.lock +++ b/composer.lock @@ -3,43 +3,9 @@ "This file locks the dependencies of your project to a known state", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" ], - "hash": "2b18cb53426361d7e85eedd5f7779053", + "hash": "e04a497fc9cee4a513a4aa41fb14c36a", "packages": [], "packages-dev": [ - { - "name": "jdgrimes/wp-l10n-validator", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/JDGrimes/wp-l10n-validator.git", - "reference": "28e32f54fdaf155268d48a83b26bb2c966cbdff7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/JDGrimes/wp-l10n-validator/zipball/28e32f54fdaf155268d48a83b26bb2c966cbdff7", - "reference": "28e32f54fdaf155268d48a83b26bb2c966cbdff7", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "J.D. Grimes", - "email": "jdg@codesymphony.co", - "homepage": "http://codesymphony.co", - "role": "Developer" - } - ], - "description": "Gettext localization validator for WordPress", - "homepage": "https://github.com/JDGrimes/wp-l10n-validator", - "time": "2015-01-07 20:43:54" - }, { "name": "jdgrimes/wp-plugin-uninstall-tester", "version": "0.4.2", @@ -73,35 +39,11 @@ "description": "Utilities for testing WordPress plugin install/uninstall with PHPUnit", "homepage": "https://github.com/JDGrimes/wp-plugin-uninstall-tester", "time": "2014-11-25 14:47:10" - }, - { - "name": "wordpoints/l10n-validator-config", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/WordPoints/l10n-validator-config.git", - "reference": "b5083fb51c17e3626b8f0279ff920d38f587971b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/WordPoints/l10n-validator-config/zipball/b5083fb51c17e3626b8f0279ff920d38f587971b", - "reference": "b5083fb51c17e3626b8f0279ff920d38f587971b", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "description": "WordPoints-specific configuration for https://github.com/JDGrimes/wp-l10n-validator", - "time": "2015-01-07 22:32:10" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "jdgrimes/wp-l10n-validator": 20 - }, + "stability-flags": [], "platform": { "php": ">=5.2.0" }, diff --git a/dev-lib b/dev-lib new file mode 160000 index 00000000..4815f590 --- /dev/null +++ b/dev-lib @@ -0,0 +1 @@ +Subproject commit 4815f59044e17d391f4a04cbe83a48e5bdee1185 diff --git a/dev-lib-wordpoints b/dev-lib-wordpoints new file mode 160000 index 00000000..f08beabb --- /dev/null +++ b/dev-lib-wordpoints @@ -0,0 +1 @@ +Subproject commit f08beabb3730bf3a1387325e1c1c89f510a92122 diff --git a/phpcs.ruleset.xml b/phpcs.ruleset.xml deleted file mode 100644 index 8b1fac48..00000000 --- a/phpcs.ruleset.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - Sniffs for the coding standards of the WordPoints plugin - - - - - - - - - - - - - - /tests/* - - - /tests/* - - - /tests/* - - - /tests/* - - - - - - /tests/* - - - /tools/* - - - - - - - - - /vendor/*,/dev-lib/* - - diff --git a/phpcs.ruleset.xml b/phpcs.ruleset.xml new file mode 120000 index 00000000..6415badf --- /dev/null +++ b/phpcs.ruleset.xml @@ -0,0 +1 @@ +dev-lib-wordpoints/phpcs/WordPoints/ruleset.xml \ No newline at end of file diff --git a/readme.txt b/readme.txt deleted file mode 100644 index 00200b0b..00000000 --- a/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -=== WordPoints === -Stable tag: 1.7.0 diff --git a/src/admin/admin.php b/src/admin/admin.php index 140a5f3b..7e5b3ce9 100644 --- a/src/admin/admin.php +++ b/src/admin/admin.php @@ -229,7 +229,7 @@ function wordpoints_admin_activate_components() { * @uses wordpoints_show_admin_message() * * @param string $message The text for the error message. - * @param string $args Other optional arguments. + * @param array $args Other optional arguments. */ function wordpoints_show_admin_error( $message, array $args = array() ) { @@ -246,35 +246,47 @@ function wordpoints_show_admin_error( $message, array $args = array() ) { * @since 1.0.0 * @since 1.2.0 The $type parameter is now properly escaped. * @since 1.8.0 The $message will be passed through wp_kses(). - * @since 1.8.0 The $args paramter was added with dismissable and option args. + * @since 1.8.0 The $args parameter was added with "dismissable" and "option" args. + * @since 1.10.0 The "dismissable" arg was renamed to "dismissible". * * @param string $message The text for the message. * @param string $type The type of message to display. Default is 'updated'. * @param array $args { * Other optional arguments. * - * @type bool $dismissable Whether this notice can be dismissed. Default is - * false (not dismissable). + * @type bool $dismissible Whether this notice can be dismissed. Default is + * false (not dismissible). * @type string $option An option to delete when if message is dismissed. - * Required when $dismissable is true. + * Required when $dismissible is true. * } */ function wordpoints_show_admin_message( $message, $type = 'updated', array $args = array() ) { $defaults = array( - 'dismissable' => false, + 'dismissible' => false, 'option' => '', ); $args = array_merge( $defaults, $args ); + if ( isset( $args['dismissable'] ) ) { + + $args['dismissible'] = $args['dismissable']; + + _deprecated_argument( + __FUNCTION__ + , '1.10.0' + , 'The "dismissable" argument has been replaced by the correct spelling, "dismissible".' + ); + } + ?>

- +
@@ -384,7 +396,7 @@ function wordpoints_install_modules_upload() { function wordpoints_upload_module_zip() { if ( ! current_user_can( 'install_wordpoints_modules' ) ) { - wp_die( esc_html__( 'You do not have sufficient permissions to install WordPoints modules on this site.', 'wordpoints' ) ); + wp_die( esc_html__( 'You do not have sufficient permissions to install WordPoints modules on this site.', 'wordpoints' ), '', array( 'response' => 403 ) ); } check_admin_referer( 'wordpoints-module-upload' ); diff --git a/src/admin/includes/class-wordpoints-modules-list-table.php b/src/admin/includes/class-wordpoints-modules-list-table.php index a3132277..17e0bbbb 100644 --- a/src/admin/includes/class-wordpoints-modules-list-table.php +++ b/src/admin/includes/class-wordpoints-modules-list-table.php @@ -96,7 +96,7 @@ public function get_table_classes() { * * @since 1.1.0 * - * @param bool Whether the current user has the required capabilities. + * @return bool Whether the current user has the required capabilities. */ public function ajax_user_can() { @@ -552,7 +552,7 @@ public function single_row( $item ) { case 'name': ?> - > + > row_actions( $this->get_module_row_actions( $module_file, $module_data, $is_active ), true ); // XSS OK WPCS ?> @@ -561,7 +561,7 @@ public function single_row( $item ) { case 'description': ?> - > + >

@@ -620,7 +620,7 @@ public function single_row( $item ) { default: ?> - > + > - - - - - - - - - + - foreach ( $components as $component ) { + is_active( $component['slug'] ) ) { @@ -155,12 +148,17 @@ - + + + + + + + + + + 403 ) ); } if ( is_multisite() && ! is_network_admin() && is_network_only_wordpoints_module( $module ) ) { @@ -68,7 +68,7 @@ } else { - wp_die( $result ); + wp_die( wordpoints_sanitize_wp_error( $result ) ); } } @@ -85,7 +85,7 @@ // Activate multiple modules. case 'activate-selected': if ( ! current_user_can( 'activate_wordpoints_modules' ) ) { - wp_die( esc_html__( 'You do not have sufficient permissions to activate modules for this site.', 'wordpoints' ) ); + wp_die( esc_html__( 'You do not have sufficient permissions to activate modules for this site.', 'wordpoints' ), '', array( 'response' => 403 ) ); } check_admin_referer( 'bulk-modules' ); @@ -141,7 +141,7 @@ // Get the fatal error from a module. case 'error_scrape': if ( ! current_user_can( 'activate_wordpoints_modules' ) ) { - wp_die( esc_html__( 'You do not have sufficient permissions to activate modules for this site.', 'wordpoints' ) ); + wp_die( esc_html__( 'You do not have sufficient permissions to activate modules for this site.', 'wordpoints' ), '', array( 'response' => 403 ) ); } check_admin_referer( 'module-activation-error_' . $module ); @@ -149,7 +149,7 @@ $valid = wordpoints_validate_module( $module ); if ( is_wp_error( $valid ) ) { - wp_die( $valid ); + wp_die( wordpoints_sanitize_wp_error( $valid ), '', array( 'response' => 400 ) ); } // Ensure that Fatal errors are displayed. @@ -185,7 +185,7 @@ function wordpoints_module_sandbox_scrape( $module ) { // Deactivate a module. case 'deactivate': if ( ! current_user_can( 'activate_wordpoints_modules' ) ) { - wp_die( esc_html__( 'You do not have sufficient permissions to deactivate modules for this site.', 'wordpoints' ) ); + wp_die( esc_html__( 'You do not have sufficient permissions to deactivate modules for this site.', 'wordpoints' ), '', array( 'response' => 403 ) ); } check_admin_referer( 'deactivate-module_' . $module ); @@ -213,7 +213,7 @@ function wordpoints_module_sandbox_scrape( $module ) { // Deactivate multiple modules. case 'deactivate-selected': if ( ! current_user_can( 'activate_wordpoints_modules' ) ) { - wp_die( esc_html__( 'You do not have sufficient permissions to deactivate modules for this site.', 'wordpoints' ) ); + wp_die( esc_html__( 'You do not have sufficient permissions to deactivate modules for this site.', 'wordpoints' ), '', array( 'response' => 403 ) ); } check_admin_referer( 'bulk-modules' ); @@ -255,7 +255,7 @@ function wordpoints_module_sandbox_scrape( $module ) { // Delete multiple modules. case 'delete-selected': if ( ! current_user_can( 'delete_wordpoints_modules' ) ) { - wp_die( esc_html__( 'You do not have sufficient permissions to delete modules for this site.', 'wordpoints' ) ); + wp_die( esc_html__( 'You do not have sufficient permissions to delete modules for this site.', 'wordpoints' ), '', array( 'response' => 403 ) ); } check_admin_referer( 'bulk-modules' ); @@ -309,7 +309,7 @@ function wordpoints_module_sandbox_scrape( $module ) { $files_to_delete[] = $module_dir . '/' . $module; $data = wordpoints_get_module_data( $module_dir . '/' . $module ); - if ( $data ) { + if ( ! empty( $data ) ) { $module_info[ $module ] = $data; $module_info[ $module ]['is_uninstallable'] = is_uninstallable_wordpoints_module( $module ); @@ -464,7 +464,7 @@ function wordpoints_module_sandbox_scrape( $module ) { 'title' => __( 'Troubleshooting', 'wordpoints' ), 'content' => '

' . esc_html__( 'Most of the time, modules play nicely with the core of WordPoints and with other modules. Sometimes, though, a module’s code will get in the way of another module, causing compatibility issues. If your site starts doing strange things, this may be the problem. Try deactivating all your modules and re-activating them in various combinations until you isolate which one(s) caused the issue.', 'wordpoints' ) . '

' . - '

' . sprintf( esc_html__( 'If something goes wrong with a module and you can’t use WordPoints, delete or rename that file in the %s directory and it will be automatically deactivated.', 'wordpoints' ), '' . esc_html( wordpoints_modules_dir() ) . '' ) . '

' + '

' . sprintf( esc_html__( 'If something goes wrong with a module and you can’t use WordPoints, delete or rename that file in the %s directory and it will be automatically deactivated.', 'wordpoints' ), '' . esc_html( wordpoints_modules_dir() ) . '' ) . '

' // XSS OK WPCS ) ); diff --git a/src/admin/screens/modules.php b/src/admin/screens/modules.php index 2b26beb7..8951a761 100644 --- a/src/admin/screens/modules.php +++ b/src/admin/screens/modules.php @@ -99,7 +99,7 @@ - + diff --git a/src/components/points/admin/admin.php b/src/components/points/admin/admin.php index 571e0407..db19b019 100644 --- a/src/components/points/admin/admin.php +++ b/src/components/points/admin/admin.php @@ -214,7 +214,7 @@ function wordpoints_admin_points_hooks_screen_options( $screen_options, $screen add_action( 'screen_settings', 'wordpoints_admin_points_hooks_screen_options', 10, 2 ); /** - * Filter the class of the points hooks page for accessiblitiy mode. + * Filter the class of the points hooks page for accessibility mode. * * @since 1.0.0 * @@ -299,7 +299,7 @@ function wordpoints_points_profile_options( $user ) { " value="" autocomplete="off" /> " /> - + @@ -379,8 +379,8 @@ function wordpoints_points_profile_options_update( $user_id ) { , $_POST[ "wordpoints_points-{$slug}" ] , $_POST[ "wordpoints_points_old-{$slug}" ] ) - && wordpoints_int( $_POST[ "wordpoints_points-{$slug}" ] ) - && wordpoints_int( $_POST[ "wordpoints_points_old-{$slug}" ] ) + && false !== wordpoints_int( $_POST[ "wordpoints_points-{$slug}" ] ) + && false !== wordpoints_int( $_POST[ "wordpoints_points_old-{$slug}" ] ) ) { wordpoints_alter_points( diff --git a/src/components/points/admin/assets/js/hooks.js b/src/components/points/admin/assets/js/hooks.js index 50f0fa05..b5f05dd6 100644 --- a/src/components/points/admin/assets/js/hooks.js +++ b/src/components/points/admin/assets/js/hooks.js @@ -7,7 +7,7 @@ * @since 1.0.0 */ -/* global ajaxurl, isRtl, WordPointsHooksL10n */ +/* global ajaxurl, isRtl, WordPointsHooksL10n, jQuery */ /** * @var object WordPointsHooks @@ -53,7 +53,7 @@ WordPointsHooks = { buttons: [ { text: WordPointsHooksL10n.deleteText, - class: 'button-primary', + 'class': 'button-primary', click: function() { $( this ).dialog( 'close' ); $currentDelete.click(); @@ -62,7 +62,7 @@ WordPointsHooks = { }, { text: WordPointsHooksL10n.cancelText, - class: 'button-secondary', + 'class': 'button-secondary', click: function() { $( this ).dialog( 'close' ); $currentDelete = false; diff --git a/src/components/points/admin/includes/ajax.php b/src/components/points/admin/includes/ajax.php index 0031b7d8..90cd3803 100644 --- a/src/components/points/admin/includes/ajax.php +++ b/src/components/points/admin/includes/ajax.php @@ -19,7 +19,7 @@ function wordpoints_ajax_points_hooks_order() { if ( check_ajax_referer( 'save-network-wordpoints-points-hooks', 'savehooks', false ) ) { if ( ! current_user_can( 'manage_network_wordpoints_points_hooks' ) ) { - wp_die( -1 ); + wp_die( -1, '', array( 'response' => 403 ) ); } // Saving network hooks order, turn on network mode. @@ -28,13 +28,13 @@ function wordpoints_ajax_points_hooks_order() { } elseif ( check_ajax_referer( 'save-wordpoints-points-hooks', 'savehooks', false ) ) { if ( ! current_user_can( 'manage_options' ) ) { - wp_die( -1 ); + wp_die( -1, '', array( 'response' => 403 ) ); } } else { // CSRF attack (or, more probably, the user left the browser open too long). - wp_die( -1 ); + wp_die( -1, '', array( 'response' => 403 ) ); } // Save hooks order for all points types. @@ -65,10 +65,10 @@ function wordpoints_ajax_points_hooks_order() { WordPoints_Points_Hooks::save_points_types_hooks( wp_unslash( $points_types_hooks ) ); - wp_die( 1 ); + wp_die( 1, '', array( 'response' => 200 ) ); } - wp_die( -1 ); + wp_die( -1, '', array( 'response' => 400 ) ); } add_action( 'wp_ajax_wordpoints-points-hooks-order', 'wordpoints_ajax_points_hooks_order' ); @@ -84,7 +84,7 @@ function wordpoints_ajax_save_points_hook() { if ( check_ajax_referer( 'save-network-wordpoints-points-hooks', 'savehooks', false ) ) { if ( ! current_user_can( 'manage_network_wordpoints_points_hooks' ) ) { - wp_die( -1 ); + wp_die( -1, '', array( 'response' => 403 ) ); } // Saving network hooks, turn on network mode. @@ -93,23 +93,23 @@ function wordpoints_ajax_save_points_hook() { } elseif ( check_ajax_referer( 'save-wordpoints-points-hooks', 'savehooks', false ) ) { if ( ! current_user_can( 'manage_options' ) ) { - wp_die( -1 ); + wp_die( -1, '', array( 'response' => 403 ) ); } } else { // CSRF attack (or, more probably the user left the browser open too long). - wp_die( -1 ); + wp_die( -1, '', array( 'response' => 403 ) ); } - $error = '

' . esc_html__( 'An error has occurred. Please reload the page and try again.', 'wordpoints' ) . '

'; + $error = __( 'An error has occurred. Please reload the page and try again.', 'wordpoints' ); if ( isset( $_POST['points-slug'] ) ) { // - We are saving the settings for a points type. if ( ! current_user_can( 'manage_wordpoints_points_types' ) ) { - wp_die( -1 ); + wp_die( -1, '', array( 'response' => 403 ) ); } $settings = array(); @@ -131,7 +131,7 @@ function wordpoints_ajax_save_points_hook() { $old_settings = wordpoints_get_points_type( $points_type ); if ( false === $old_settings ) { - wp_die( -1 ); + wp_die( -1, '', array( 'response' => 200 ) ); } if ( is_array( $old_settings ) ) { @@ -151,7 +151,7 @@ function wordpoints_ajax_save_points_hook() { // - We are creating/updating/deleting an instance of a hook. if ( ! isset( $_POST['id_base'], $_POST['hook-id'], $_POST['points_type'], $_POST['hook_number'] ) ) { - wp_die( -1 ); + wp_die( -1, '', array( 'response' => 400 ) ); } $id_base = sanitize_key( $_POST['id_base'] ); @@ -169,7 +169,7 @@ function wordpoints_ajax_save_points_hook() { // This holds the ID number if the hook is brand new. if ( ! isset( $_POST['multi_number'] ) || ! wordpoints_posint( $_POST['multi_number'] ) ) { - wp_die( $error ); + wp_die( '

' . esc_html( $error ) . '

', '', array( 'response' => 400 ) ); } $number = (int) $_POST['multi_number']; @@ -194,7 +194,7 @@ function wordpoints_ajax_save_points_hook() { // - We are deleting a hook instance. if ( false === $hook ) { - wp_die( $error ); + wp_die( '

' . esc_html( $error ) . '

', '', array( 'response' => 400 ) ); } $hook->delete_callback( $number ); @@ -204,9 +204,7 @@ function wordpoints_ajax_save_points_hook() { WordPoints_Points_Hooks::save_points_types_hooks( $points_types_hooks ); - echo esc_html( "deleted:{$hook_id}" ); - - wp_die(); + wp_die( esc_html( "deleted:{$hook_id}" ), '', array( 'response' => 200 ) ); } elseif ( $settings && false === $hook ) { @@ -231,7 +229,7 @@ function wordpoints_ajax_save_points_hook() { // - We are updating the settings for an instance of a hook. if ( false === $hook ) { - wp_die( $error ); + wp_die( '

' . esc_html( $error ) . '

', '', array( 'response' => 400 ) ); } $new_instance = ( ! empty( $settings ) ) ? reset( $settings ) : array(); @@ -245,7 +243,7 @@ function wordpoints_ajax_save_points_hook() { } // if ( isset( $_POST['points-name'] ) ) {} else - wp_die(); + wp_die( '', '', array( 'response' => 200 ) ); } add_action( 'wp_ajax_save-wordpoints-points-hook', 'wordpoints_ajax_save_points_hook' ); diff --git a/src/components/points/includes/class-un-installer.php b/src/components/points/includes/class-un-installer.php index 6177ce62..4cb84daf 100644 --- a/src/components/points/includes/class-un-installer.php +++ b/src/components/points/includes/class-un-installer.php @@ -27,18 +27,19 @@ class WordPoints_Points_Un_Installer extends WordPoints_Un_Installer_Base { * @since 1.8.0 */ protected $updates = array( - '1.2.0' => array( 'single' => true, /* - */ 'network' => true ), - '1.4.0' => array( 'single' => true, 'site' => true, 'network' => true ), - '1.5.0' => array( /* - */ 'site' => true /* - */ ), - '1.5.1' => array( 'single' => true, /* - */ 'network' => true ), - '1.8.0' => array( /* - */ 'site' => true /* - */ ), - '1.9.0' => array( 'single' => true, 'site' => true, 'network' => true ), + '1.2.0' => array( 'single' => true, /* - */ 'network' => true ), + '1.4.0' => array( 'single' => true, 'site' => true, 'network' => true ), + '1.5.0' => array( /* - */ 'site' => true /* - */ ), + '1.5.1' => array( 'single' => true, /* - */ 'network' => true ), + '1.8.0' => array( /* - */ 'site' => true /* - */ ), + '1.9.0' => array( 'single' => true, 'site' => true, 'network' => true ), + '1.10.0' => array( 'single' => true, /* - */ 'network' => true ), ); /** * The points types the user has created. * - * Used during uninstall to keep from having to retreive them when looping over + * Used during uninstall to keep from having to retrieve them when looping over * sites on multisite. * * @since 1.8.0 @@ -795,7 +796,7 @@ protected function _1_9_0_combine_hooks( $type, $reverse_type ) { ); } - // Now we check if there are any unpaired reverse typ hooks. If there are + // Now we check if there are any unpaired reverse type hooks. If there are // we'll set this flag in the database that will keep some legacy features // enabled. if ( $reverse_hook->get_instances( $hook_type ) ) { @@ -805,6 +806,56 @@ protected function _1_9_0_combine_hooks( $type, $reverse_type ) { ); } } + + /** + * Update a site to 1.10.0. + * + * @since 1.10.0 + */ + protected function update_network_to_1_10_0() { + $this->_1_10_0_delete_post_title_points_log_meta( true ); + } + + /** + * Update a single site to 1.10.0. + * + * @since 1.10.0 + */ + protected function update_single_to_1_10_0() { + $this->_1_10_0_delete_post_title_points_log_meta(); + } + + /** + * Delete the no longer used 'post_title' metadata from post delete points logs. + * + * @since 1.10.0 + * + * @param bool $network_wide Whether to delete all of the metadata for the whole + * network, or just the current site (default). + */ + protected function _1_10_0_delete_post_title_points_log_meta( $network_wide = false ) { + + $query_args = array( + 'log_type' => 'post_delete', + 'meta_query' => array( + array( 'key' => 'post_title', 'compare' => 'EXISTS' ), + ), + ); + + if ( $network_wide ) { + $query_args['blog_id'] = false; + } + + $query = new WordPoints_Points_Logs_Query( $query_args ); + + $logs = $query->get(); + + foreach ( $logs as $log ) { + wordpoints_delete_points_log_meta( $log->id, 'post_title' ); + } + + wordpoints_regenerate_points_logs( $logs ); + } } return 'WordPoints_Points_Un_Installer'; diff --git a/src/components/points/includes/class-wordpoints-points-hooks.php b/src/components/points/includes/class-wordpoints-points-hooks.php index 039140d5..7d2f52c2 100644 --- a/src/components/points/includes/class-wordpoints-points-hooks.php +++ b/src/components/points/includes/class-wordpoints-points-hooks.php @@ -481,7 +481,9 @@ public static function save_points_types_hooks( array $points_types_hooks ) { * * @since 1.0.0 * - * @param string|false $hook_id The ID of the hook. False if not found. + * @param string $hook_id The ID of the hook. + * + * @return string|false The points type for the hook. False if not found. */ public static function get_points_type( $hook_id ) { @@ -762,8 +764,8 @@ private static function _list_hook( $hook_id, $hook, $points_type = null ) { - - + + @@ -773,7 +775,7 @@ private static function _list_hook( $hook_id, $hook, $points_type = null ) { |
-
+
"hook-{$id_format}-savehook" ) ); ?>
@@ -783,7 +785,9 @@ private static function _list_hook( $hook_id, $hook, $points_type = null ) {
- get_name() ) ) . "\n"; ?> + + +
diff --git a/src/components/points/includes/class-wordpoints-points-logs-query.php b/src/components/points/includes/class-wordpoints-points-logs-query.php index 628562b4..50020577 100644 --- a/src/components/points/includes/class-wordpoints-points-logs-query.php +++ b/src/components/points/includes/class-wordpoints-points-logs-query.php @@ -566,7 +566,7 @@ public function get_sql( $select_type = null ) { * * @param string $key The cache key to use. * @param string $deprecated Deprecated; no longer used. - * @param string $network Whether this is a network-wide query. + * @param bool $network Whether this is a network-wide query. */ public function prime_cache( $key = 'default:%points_type%', $deprecated = null, $network = false ) { diff --git a/src/components/points/includes/functions.php b/src/components/points/includes/functions.php index 7126461d..680f696d 100644 --- a/src/components/points/includes/functions.php +++ b/src/components/points/includes/functions.php @@ -260,7 +260,19 @@ function wordpoints_points_logs_custom_meta_key_message( $points_type ) { */ function wordpoints_points_add_global_cache_groups() { - wp_cache_add_global_groups( 'wordpoints_network_points_logs_query' ); + if ( function_exists( 'wp_cache_add_global_groups' ) ) { + + $groups = array( + 'wordpoints_network_points_logs_query', + 'wordpoints_points_log_meta', + ); + + if ( is_wordpoints_network_active() ) { + $groups[] = 'wordpoints_points_top_users'; + } + + wp_cache_add_global_groups( $groups ); + } } add_action( 'init', 'wordpoints_points_add_global_cache_groups', 5 ); diff --git a/src/components/points/includes/hooks/abstracts/post-type.php b/src/components/points/includes/hooks/abstracts/post-type.php index 17af69a5..0cf78fa4 100644 --- a/src/components/points/includes/hooks/abstracts/post-type.php +++ b/src/components/points/includes/hooks/abstracts/post-type.php @@ -34,7 +34,7 @@ abstract class WordPoints_Post_Type_Points_Hook_Base extends WordPoints_Points_H */ public function __construct( $title, $args ) { - parent::init( $title, $args ); + $this->init( $title, $args ); add_filter( "wordpoints_points_log-{$this->log_type}", array( $this, 'logs' ), 10, 6 ); add_filter( "wordpoints_points_log-reverse_{$this->log_type}", array( $this, 'logs' ), 10, 6 ); @@ -117,7 +117,6 @@ protected function get_logs_to_auto_reverse( array $meta_query ) { array( 'key' => 'auto_reversed', 'compare' => 'NOT EXISTS', - 'value' => 'see bug #23268 (fixed in 3.9)', ), ), ) diff --git a/src/components/points/includes/hooks/comment-removed.php b/src/components/points/includes/hooks/comment-removed.php index 83da47a0..76cbb131 100644 --- a/src/components/points/includes/hooks/comment-removed.php +++ b/src/components/points/includes/hooks/comment-removed.php @@ -40,7 +40,7 @@ class WordPoints_Comment_Removed_Points_Hook extends WordPoints_Post_Type_Points */ public function __construct() { - parent::init( + $this->init( _x( 'Comment Removed', 'points hook name', 'wordpoints' ) , array( 'description' => __( 'Comment removed from the site.', 'wordpoints' ), diff --git a/src/components/points/includes/hooks/periodic.php b/src/components/points/includes/hooks/periodic.php index e223def1..76ab7122 100644 --- a/src/components/points/includes/hooks/periodic.php +++ b/src/components/points/includes/hooks/periodic.php @@ -39,7 +39,10 @@ class WordPoints_Periodic_Points_Hook extends WordPoints_Points_Hook { */ public function __construct() { - parent::init( _x( 'Periodic Points', 'points hook name', 'wordpoints' ), array( 'description' => __( 'Visiting the site at least once in a given time period.', 'wordpoints' ) ) ); + $this->init( + _x( 'Periodic Points', 'points hook name', 'wordpoints' ) + , array( 'description' => __( 'Visiting the site at least once in a given time period.', 'wordpoints' ) ) + ); add_action( 'init', array( $this, 'hook' ) ); diff --git a/src/components/points/includes/hooks/post-delete.php b/src/components/points/includes/hooks/post-delete.php index 48c2ef27..6529bede 100644 --- a/src/components/points/includes/hooks/post-delete.php +++ b/src/components/points/includes/hooks/post-delete.php @@ -42,7 +42,7 @@ class WordPoints_Post_Delete_Points_Hook extends WordPoints_Post_Type_Points_Hoo */ public function __construct() { - parent::init( + $this->init( _x( 'Post Delete', 'points hook name', 'wordpoints' ) ,array( 'description' => __( 'A post is permanently deleted.', 'wordpoints' ), diff --git a/src/components/points/includes/hooks/post.php b/src/components/points/includes/hooks/post.php index d69008bb..a41fd27c 100644 --- a/src/components/points/includes/hooks/post.php +++ b/src/components/points/includes/hooks/post.php @@ -197,7 +197,7 @@ public function delete_hook( $post_id ) { */ public function publish_logs( $text, $points, $points_type, $user_id, $log_type, $meta ) { - return parent::logs( $text, $points, $points_type, $user_id, $log_type, $meta ); + return $this->logs( $text, $points, $points_type, $user_id, $log_type, $meta ); } /** diff --git a/src/components/points/includes/hooks/registration.php b/src/components/points/includes/hooks/registration.php index 946b2ae4..14dce047 100644 --- a/src/components/points/includes/hooks/registration.php +++ b/src/components/points/includes/hooks/registration.php @@ -38,7 +38,7 @@ class WordPoints_Registration_Points_Hook extends WordPoints_Points_Hook { */ public function __construct() { - parent::init( + $this->init( _x( 'Registration', 'points hook name', 'wordpoints' ) , array( 'description' => _x( 'Registering with the site.', 'points hook description', 'wordpoints' ) ) ); diff --git a/src/components/points/includes/logs.php b/src/components/points/includes/logs.php index 52275da0..4afa35c4 100644 --- a/src/components/points/includes/logs.php +++ b/src/components/points/includes/logs.php @@ -502,20 +502,10 @@ function wordpoints_show_points_logs( $logs_query, array $args = array() ) { - - - - - - - - - - - + @@ -566,6 +556,16 @@ function wordpoints_show_points_logs( $logs_query, array $args = array() ) { ?> + + + + + + + + + + @@ -698,20 +698,15 @@ function wordpoints_points_logs_post_delete( $text, $points, $points_type, $user if ( ! is_null( $post_type ) ) { - /* translators: 1 is the post type name, 2 is the post title. */ + /* translators: the post type's name. */ return sprintf( - _x( '%1$s “%2$s” deleted.', 'points log description', 'wordpoints' ) + _x( '%s deleted.', 'points log description', 'wordpoints' ) , $post_type->labels->singular_name - , $meta['post_title'] ); } } - /* translators: %s will be the post title. */ - return sprintf( - _x( 'Post “%s” deleted.', 'points log description', 'wordpoints' ) - , $meta['post_title'] - ); + return _x( 'Post deleted.', 'points log description', 'wordpoints' ); } add_action( 'wordpoints_points_log-post_delete', 'wordpoints_points_logs_post_delete', 10, 6 ); diff --git a/src/components/points/includes/points.php b/src/components/points/includes/points.php index e29a8b21..387bdf69 100644 --- a/src/components/points/includes/points.php +++ b/src/components/points/includes/points.php @@ -429,24 +429,13 @@ function wordpoints_get_formatted_points( $user_id, $type, $context ) { * * @since 1.0.0 * - * @uses wordpoints_get_points() To get the user's points. - * @uses wordpoints_format_points() To format the points for display. - * * @param int $user_id The ID of the user whose points to display. * @param string $type The type of points to display. * @param string $context The context in which the points will be displayed. - * - * @return void This function does not return a value, it displays directly. */ function wordpoints_display_points( $user_id, $type, $context ) { - $points = wordpoints_get_points( $user_id, $type ); - - if ( false === $points ) { - return; - } - - echo wordpoints_format_points( $points, $type, $context ); + echo wordpoints_get_formatted_points( $user_id, $type, $context ); // XSS OK, WPCS } /** @@ -863,6 +852,8 @@ function wordpoints_update_points_log_meta( $log_id, $meta_key, $meta_value, $pr * @param int $log_id The ID of the transaction. * @param string $meta_key The meta key to update. * @param mixed $meta_value The new value for this meta key. + * @param bool $delete_all Whether to delete metadata for all matching logs, or + * only the one specified by $log_id (default). * * @return bool Whether any rows where deleted. */ @@ -1030,7 +1021,7 @@ function wordpoints_regenerate_points_logs( $logs ) { * * @since 1.0.0 * - * @param array $num_users The number of users to retrieve. + * @param int $num_users The number of users to retrieve. * @param string $points_type The type of points. * * @return int[] The IDs of the users with the most points. @@ -1105,8 +1096,9 @@ function wordpoints_points_get_top_users( $num_users, $points_type ) { * * @since 1.7.0 * - * @param array $num_users The number of users to display. + * @param int $num_users The number of users to display. * @param string $points_type The type of points. + * @param string $context The context in which the table is being displayed. */ function wordpoints_points_show_top_users( $num_users, $points_type, $context = 'default' ) { @@ -1156,13 +1148,6 @@ function wordpoints_points_show_top_users( $num_users, $points_type, $context = - - - - - - - + + + + + + + ', $text, '
'; + echo '
', $text, '

'; // XSS OK, WPCS if ( 0 !== $instance['number_logs'] ) { diff --git a/src/components/ranks/admin/assets/js/ranks-screen.js b/src/components/ranks/admin/assets/js/ranks-screen.js index d0336d22..110d5442 100644 --- a/src/components/ranks/admin/assets/js/ranks-screen.js +++ b/src/components/ranks/admin/assets/js/ranks-screen.js @@ -101,9 +101,9 @@ jQuery( function ( $ ) { // Default attributes for the rank type. defaults: function() { return { - name: '', + name: '' }; - }, + } }); // Rank View @@ -242,15 +242,15 @@ jQuery( function ( $ ) { buttons: [ { text: ranks.l10n.deleteText, - class: 'button-primary', + 'class': 'button-primary', click: function() { $( this ).dialog( 'close' ); - view.delete(); + view.destroy(); } }, { text: ranks.l10n.cancelText, - class: 'button-secondary', + 'class': 'button-secondary', click: function() { $( this ).dialog( 'close' ); } @@ -260,7 +260,7 @@ jQuery( function ( $ ) { }, // Remove the item, destroy the model. - delete: function () { + destroy: function () { this.wait(); diff --git a/src/components/ranks/includes/class-wordpoints-rank-groups.php b/src/components/ranks/includes/class-wordpoints-rank-groups.php index b76b94c2..3a11e825 100644 --- a/src/components/ranks/includes/class-wordpoints-rank-groups.php +++ b/src/components/ranks/includes/class-wordpoints-rank-groups.php @@ -21,7 +21,7 @@ final class WordPoints_Rank_Groups { * * @type WordPoints_Rank_Group[] $groups */ - private static $groups; + private static $groups = array(); /** * Check if a group is registered. @@ -100,10 +100,6 @@ public static function get() { ); } - if ( ! self::$groups ) { - self::$groups = array(); - } - return self::$groups; } diff --git a/src/components/ranks/includes/class-wordpoints-rank-type.php b/src/components/ranks/includes/class-wordpoints-rank-type.php index b60a2fda..b1a06d50 100644 --- a/src/components/ranks/includes/class-wordpoints-rank-type.php +++ b/src/components/ranks/includes/class-wordpoints-rank-type.php @@ -171,6 +171,14 @@ final public function get_meta_fields() { * @since 1.7.0 * * @param array $meta The metadata for a rank of this type. + * @param array $args { + * Arguments controlling the way the fields are displayed. + * + * @type bool $placeholders Whether to just display Underscore template + * placeholders instead of the actual field + * values. Default is false. Does not affect + * hidden fields. + * } */ final public function display_rank_meta_form_fields( array $meta = array(), @@ -183,7 +191,7 @@ final public function display_rank_meta_form_fields( // If we aren't using placeholders, calculate the value. Hidden fields // never use placeholders. - if ( false !== $args['placeholders'] || 'hidden' === $field['type'] ) { + if ( ! $args['placeholders'] || 'hidden' === $field['type'] ) { // Default to the default value. $value = $field['default']; @@ -211,7 +219,7 @@ final public function display_rank_meta_form_fields( value="<% if ( typeof !== "undefined" ) { print( ); } %>" - value="" + value="" class="widefat" /> diff --git a/src/includes/class-un-installer-base.php b/src/includes/class-un-installer-base.php index 3478a757..19b6d470 100644 --- a/src/includes/class-un-installer-base.php +++ b/src/includes/class-un-installer-base.php @@ -511,7 +511,7 @@ abstract protected function install_network(); abstract protected function install_site(); /** - * Innstall on a single site. + * Install on a single site. * * This runs when the WordPress site is not a multisite. It should completely * install the entity. @@ -521,7 +521,7 @@ abstract protected function install_site(); abstract protected function install_single(); /** - * Load any dependencies of the unisntall code. + * Load any dependencies of the uninstall code. * * @since 1.8.0 */ diff --git a/src/includes/class-wordpoints-components.php b/src/includes/class-wordpoints-components.php index 1d355f50..227571a1 100644 --- a/src/includes/class-wordpoints-components.php +++ b/src/includes/class-wordpoints-components.php @@ -224,6 +224,24 @@ public function get() { return $this->registered; } + /** + * Get the data for a component. + * + * @since 1.10.0 + * + * @param string $slug The slug of the component to get the data for. + * + * @return array|false The component, or false if it isn't registered. + */ + public function get_component( $slug ) { + + if ( ! isset( $this->registered[ $slug ] ) ) { + return false; + } + + return $this->registered[ $slug ]; + } + /** * Get all active components. * diff --git a/src/includes/constants.php b/src/includes/constants.php index f1f632ac..4dbc1055 100644 --- a/src/includes/constants.php +++ b/src/includes/constants.php @@ -16,7 +16,7 @@ * * @const WORDPOINTS_VERSION */ -define( 'WORDPOINTS_VERSION', '1.9.0' ); +define( 'WORDPOINTS_VERSION', '1.10.0' ); /** * The full path to the plugin's main directory. diff --git a/src/includes/functions.php b/src/includes/functions.php index c3ef6c3b..7db82160 100644 --- a/src/includes/functions.php +++ b/src/includes/functions.php @@ -173,8 +173,59 @@ function wordpoints_verify_nonce( return false; } +/** + * Sanitize a WP_Error object for passing directly to wp_die(). + * + * The wp_die() function accepts an WP_Error object as the first parameter, but it + * does not sanitize it's contents before printing it out to the user. By passing + * the object through this function before giving it to wp_die(), the potential for + * XSS should be avoided. + * + * Example: + * + * wp_die( wordpoints_sanitize_wp_error( $error ) ); + * + * @since 1.10.0 + * + * @param WP_Error $error The error to sanitize. + * + * @return WP_Error The sanitized error. + */ +function wordpoints_sanitize_wp_error( $error ) { + + $code = $error->get_error_code(); + + $error_data = $error->error_data; + + if ( isset( $error_data[ $code ]['title'] ) ) { + + $error_data[ $code ]['title'] = wp_kses( + $error->error_data[ $code ]['title'] + , 'wordpoints_sanitize_wp_error_title' + ); + + $error->error_data = $error_data; + } + + $all_errors = $error->errors; + + foreach ( $all_errors as $code => $errors ) { + + foreach ( $errors as $key => $message ) { + $all_errors[ $code ][ $key ] = wp_kses( + $message + , 'wordpoints_sanitize_wp_error_message' + ); + } + } + + $error->errors = $all_errors; + + return $error; +} + // -// Databae Helpers. +// Database Helpers. // /** @@ -184,7 +235,7 @@ function wordpoints_verify_nonce( * array. * * @since 1.0.0 - * @since 1.1.0 The $conext parameter was added for site options. + * @since 1.1.0 The $context parameter was added for site options. * @since 1.2.0 The 'network' context was added. * * @param string $option The name of the option to get. @@ -608,6 +659,8 @@ function wordpoints_get_excluded_users( $context ) { * @since 1.8.0 The $message now supports WP_Error objects. * * @param string|WP_Error $message The error message. + * + * @return string The error message. */ function wordpoints_shortcode_error( $message ) { @@ -797,4 +850,17 @@ function wordpoints_ranks_component_register() { } add_action( 'wordpoints_components_register', 'wordpoints_ranks_component_register' ); +/** + * Initialize the plugin's cache groups. + * + * @since 1.10.0 + */ +function wordpoints_init_cache_groups() { + + if ( function_exists( 'wp_cache_add_non_persistent_groups' ) ) { + wp_cache_add_non_persistent_groups( array( 'wordpoints_modules' ) ); + } +} +add_action( 'init', 'wordpoints_init_cache_groups', 5 ); + // EOF diff --git a/src/includes/modules.php b/src/includes/modules.php index f2e28bcd..dff24f8a 100644 --- a/src/includes/modules.php +++ b/src/includes/modules.php @@ -362,6 +362,7 @@ function wordpoints_module_basename( $file ) { * * @since 1.1.0 * @since 1.6.0 The 'update_api' and 'ID' headers are now supported. + * @since 1.10.0 The 'update_api' header is deprecated in favor of 'channel'. * * @param string $module_file The file to parse for the headers. * @param bool $markup Whether to mark up the module data for display (default). @@ -381,7 +382,7 @@ function wordpoints_module_basename( $file ) { * @type string $text_domain The module's text domain. * @type string $domain_path The folder containing the module's *.mo translation files. * @type bool $network Whether the module should only be network activated. - * @type string $update_api The update service to be used for this module. + * @type string $channel The URL of the update service to be used for this module. * @type mixed $ID A unique identifier for this module, used by the update service. * } */ @@ -398,11 +399,16 @@ function wordpoints_get_module_data( $module_file, $markup = true, $translate = 'domain_path' => 'Domain Path', 'network' => 'Network', 'update_api' => 'Update API', + 'channel' => 'Channel', 'ID' => 'ID', ); $module_data = get_file_data( $module_file, $default_headers, 'module' ); + if ( ! empty( $module_data['update_api'] ) ) { + _deprecated_argument( __FUNCTION__, '1.10.0', 'The "Update API" module header has been deprecated in favor of "Channel".' ); + } + $module_data['network'] = ( 'true' === strtolower( $module_data['network'] ) ); if ( $markup || $translate ) { @@ -622,7 +628,7 @@ function wordpoints_get_modules( $module_folder = '' ) { * * @since 1.1.0 * - * @param $module The module's main file. + * @param string $module The module's main file. * * @return true|WP_Error True on success, a WP_Error on failure. */ diff --git a/src/languages/wordpoints-es_ES.mo b/src/languages/wordpoints-es_ES.mo index ab32a618..2f4f2da2 100755 Binary files a/src/languages/wordpoints-es_ES.mo and b/src/languages/wordpoints-es_ES.mo differ diff --git a/src/languages/wordpoints-es_ES.po b/src/languages/wordpoints-es_ES.po index 213691ff..42b63d44 100644 --- a/src/languages/wordpoints-es_ES.po +++ b/src/languages/wordpoints-es_ES.po @@ -2,17 +2,19 @@ msgid "" msgstr "" "Project-Id-Version: WordPoints 1.5.0\n" "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/wordpoints\n" -"POT-Creation-Date: 2015-01-30 22:50:22+00:00\n" -"PO-Revision-Date: 2014-08-04 10:51+0100\n" -"Last-Translator: jelena kovacevic \n" -"Language-Team: LANGUAGE \n" -"Language: \n" +"POT-Creation-Date: 2015-02-27 21:33:55+00:00\n" +"PO-Revision-Date: 2015-02-24 19:20+0200\n" +"Last-Translator: Gonzalo Exequiel Pedone \n" +"Language-Team: Spanish \n" +"Language: es_ES\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.5\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 2.3-dev\n" -#. #-#-#-#-# wordpoints.pot (WordPoints 1.9.0) #-#-#-#-# +#. #-#-#-#-# wordpoints.pot (WordPoints 1.10.0) #-#-#-#-# #. Plugin Name of the plugin/theme #: admin/admin.php:67 components/points/admin/admin.php:280 #: components/points/includes/widgets.php:120 @@ -46,34 +48,34 @@ msgstr "WordPoints - Instalar módulos" msgid "Install Modules" msgstr "Instalar módulos" -#: admin/admin.php:281 +#: admin/admin.php:293 msgid "Hide This Notice" -msgstr "" +msgstr "Ocultar Este Aviso" -#: admin/admin.php:334 +#: admin/admin.php:346 #, fuzzy msgid "WordPoints — %s" msgstr "WordPoints - %s" -#: admin/admin.php:364 +#: admin/admin.php:376 msgid "Install a module in .zip format" msgstr "Instale un módulo en formato zip" -#: admin/admin.php:365 +#: admin/admin.php:377 msgid "" "If you have a module in a .zip format, you may install it by uploading it " "here." msgstr "Si tiene un módulo en formato zip, podrá instalarlo, subiéndolo aquí." -#: admin/admin.php:368 +#: admin/admin.php:380 msgid "Module zip file" msgstr "Archivo zip de Módulo" -#: admin/admin.php:370 +#: admin/admin.php:382 msgid "Install Now" msgstr "Instalar Ahora" -#: admin/admin.php:387 +#: admin/admin.php:399 msgid "" "You do not have sufficient permissions to install WordPoints modules on this " "site." @@ -81,25 +83,27 @@ msgstr "" "Usted no tiene permisos suficientes para instalar módulos WordPoints en este " "sitio." -#: admin/admin.php:394 +#: admin/admin.php:406 msgid "Upload WordPoints Module" msgstr "Subir Módulo WordPoints" -#: admin/admin.php:406 +#: admin/admin.php:418 msgid "Installing Module from uploaded file: %s" msgstr "Instalar Módulo desde archivo cargado: %s" -#: admin/admin.php:470 +#: admin/admin.php:482 msgid "" "This appears to be a WordPoints module archive. Try installing it on the " "WordPoints module install screen instead." msgstr "" +"Este parece ser un archivo de módulo de WordPoints. En su lugar, pruebe a " +"instalarlo desde la pantalla de módulos de WordPoints." -#: admin/admin.php:500 +#: admin/admin.php:512 msgid "Like this plugin?" msgstr "¿Le gusta este plugin?" -#: admin/admin.php:501 +#: admin/admin.php:513 msgid "" "If you think WordPoints is great, let everyone know by giving it a 5 star rating." @@ -107,7 +111,7 @@ msgstr "" "Si piensa que WordPoints es maravilloso, permita que todos lo sepan dándole " "una 5 estrellas calificación ." -#: admin/admin.php:502 +#: admin/admin.php:514 msgid "" "If you don’t think this plugin deserves 5 stars, please let us know " "how we can improve it." @@ -115,11 +119,11 @@ msgstr "" "Si usted no cree que este plugin se merece 5 estrellas, por favor háganos " "saber cómo podemos mejorarlo." -#: admin/admin.php:505 +#: admin/admin.php:517 msgid "Need help?" msgstr "¿Necesita ayuda?" -#: admin/admin.php:506 +#: admin/admin.php:518 msgid "" "Post your feature request or support question in the support " "forums" @@ -127,31 +131,37 @@ msgstr "" "Publique una solicitud de función o soporte pregunta en el " "foros de soporte " -#: admin/admin.php:507 +#: admin/admin.php:519 msgid "Thank you for using WordPoints!" msgstr "¡Gracias por utilizar WordPoints!" -#: admin/admin.php:540 +#: admin/admin.php:552 msgid "" "WordPoints detected a large network and has skipped part of the installation " "process." msgstr "" +"WordPoints a detectado una red amplia y a saltado parte del proceso de " +"instalación." -#: admin/admin.php:543 +#: admin/admin.php:555 msgid "" "WordPoints detected a large network and has skipped part of the update " "process for version %s (and possibly later versions)." msgstr "" +"WordPoints a detectado una red amplia y a saltado parte del proceso de " +"actualización para la versión %s (y posiblemente versiones posteriores)." -#: admin/admin.php:549 +#: admin/admin.php:561 msgid "" "The rest of the process needs to be completed manually. If this has not been " "done already, some parts of the plugin may not function properly." msgstr "" +"El resto del proceso necesita completarse manualmente. Si no lo ha hecho " +"todavía, algunas opciones del plugin podrían no funcionar apropiadamente." -#: admin/admin.php:550 includes/class-wordpoints-components.php:556 +#: admin/admin.php:562 includes/class-wordpoints-components.php:574 msgid "Learn more." -msgstr "" +msgstr "Aprenda mas." #: admin/includes/class-wordpoints-module-installer-skin.php:84 #: admin/includes/class-wordpoints-modules-list-table.php:427 @@ -189,28 +199,27 @@ msgstr "El módulo no contiene archivos." #: admin/includes/class-wordpoints-module-installer.php:56 msgid "Module install failed." -msgstr "Error al instalar Módulo" +msgstr "Error al instalar el módulo." #: admin/includes/class-wordpoints-module-installer.php:57 msgid "Module installed successfully." -msgstr "Módulo instalado correctamente" +msgstr "Módulo instalado correctamente." #: admin/includes/class-wordpoints-module-installer.php:58 msgid "Could not create the modules directory." -msgstr "No se pudo crear el directorio de módulos" +msgstr "No se pudo crear el directorio de módulos." #: admin/includes/class-wordpoints-module-installer.php:184 msgid "No valid modules were found." -msgstr "No se encontraron módulos válidos" +msgstr "No se encontraron módulos válidos." #: admin/includes/class-wordpoints-modules-list-table.php:319 msgid "No modules found." -msgstr "No se encontraron módulos" +msgstr "No se encontraron módulos." #: admin/includes/class-wordpoints-modules-list-table.php:321 -#, fuzzy msgid "There are not any modules installed." -msgstr "No hay ganchos de puntos disponibles en la actualidad." +msgstr "No hay módulos instalados." #: admin/includes/class-wordpoints-modules-list-table.php:336 msgid "Module" @@ -224,14 +233,14 @@ msgstr "Descripción" msgctxt "modules" msgid "All (%s)" msgid_plural "All (%s)" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "Todos (%s)" +msgstr[1] "Todos (%s)" #: admin/includes/class-wordpoints-modules-list-table.php:367 msgid "Active (%s)" msgid_plural "Active (%s)" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "Activo (%s)" +msgstr[1] "Activos (%s)" #: admin/includes/class-wordpoints-modules-list-table.php:371 msgid "Recently Active (%s)" @@ -247,7 +256,7 @@ msgstr[1] "" #: admin/includes/class-wordpoints-modules-list-table.php:427 #: admin/includes/class-wordpoints-modules-list-table.php:722 -#: admin/screens/configure-components.php:115 +#: admin/screens/configure-components.php:108 msgid "Activate" msgstr "Activar" @@ -258,7 +267,7 @@ msgstr "Desactivar Red" #: admin/includes/class-wordpoints-modules-list-table.php:431 #: admin/includes/class-wordpoints-modules-list-table.php:718 -#: admin/screens/configure-components.php:110 +#: admin/screens/configure-components.php:103 msgid "Deactivate" msgstr "Desactivar" @@ -266,7 +275,7 @@ msgstr "Desactivar" #: admin/includes/class-wordpoints-modules-list-table.php:710 #: admin/includes/class-wordpoints-modules-list-table.php:725 #: components/points/admin/admin.php:54 -#: components/points/includes/class-wordpoints-points-hooks.php:773 +#: components/points/includes/class-wordpoints-points-hooks.php:775 #: components/ranks/admin/admin.php:53 #: components/ranks/admin/screens/ranks.php:128 msgid "Delete" @@ -286,7 +295,7 @@ msgstr "Versión %s" #. translators: %s is the component author's name. #: admin/includes/class-wordpoints-modules-list-table.php:591 -#: admin/screens/configure-components.php:136 +#: admin/screens/configure-components.php:129 msgid "By %s" msgstr "Por %s" @@ -322,25 +331,25 @@ msgid "Installed WordPoints components." msgstr "Ver componentes WordPoints instalados." #: admin/screens/configure-components.php:88 -#: admin/screens/configure-components.php:96 +#: admin/screens/configure-components.php:156 msgctxt "components table heading" msgid "Component" msgstr "Componente" #: admin/screens/configure-components.php:89 -#: admin/screens/configure-components.php:97 +#: admin/screens/configure-components.php:157 msgctxt "components table heading" msgid "Description" msgstr "Descripción" #: admin/screens/configure-components.php:90 -#: admin/screens/configure-components.php:98 +#: admin/screens/configure-components.php:158 msgctxt "components table heading" msgid "Version" msgstr "Versión" #: admin/screens/configure-components.php:91 -#: admin/screens/configure-components.php:99 +#: admin/screens/configure-components.php:159 msgctxt "components table heading" msgid "Action" msgstr "Acción" @@ -358,7 +367,7 @@ msgid "" "simple and easy to use." msgstr "" "WordPoints no tiene una gran cantidad de opciones de configuración, lo que " -"hace que sea sencillo y fácil de usar" +"hace que sea sencillo y fácil de usar." #: admin/screens/configure-settings-load.php:18 msgid "" @@ -586,7 +595,7 @@ msgstr "" #: admin/screens/modules.php:24 msgid "You cannot delete a module while it is active on the main site." msgstr "" -"No se puede eliminar un módulo mientras está activo en el sitio principal" +"No se puede eliminar un módulo mientras está activo en el sitio principal." #: admin/screens/modules.php:28 msgid "" @@ -605,8 +614,8 @@ msgid "" "Module could not be activated because it triggered a fatal error." msgstr "" -"El Módulo no se pudo activar debido a que provocó un error grave" +"El Módulo no se pudo activar debido a que provocó un error grave." #: admin/screens/modules.php:65 msgid "Module could not be deleted due to an error: %s" @@ -727,11 +736,11 @@ msgstr "" "deseado en el campo de texto, y marque la casilla de verificación junto a " "él. Si no marca la casilla de verificación, no se guardarán los cambios. " "Para proporcionar una razón para el cambio, rellene el campo de texto de " -"abajo" +"abajo." #: components/points/admin/admin.php:282 msgid "Reason" -msgstr "Razón." +msgstr "Razón" #. translators: %s is the number of points. #: components/points/admin/admin.php:302 @@ -957,16 +966,16 @@ msgid "" "Drag hooks from here to a points type on the right to activate them. Drag " "hooks back here to deactivate them and delete their settings." msgstr "" -"Arrastre ganchos de aquí a un tipo de puntos a la derecha para activarlos. " -"Ganchos Arrastre de nuevo los ganchos aquí para desactivarlos y eliminar su " -"configuración" +"Arrastre los ganchos de aquí a un tipo de puntos a la derecha para " +"activarlos. Arrastre de nuevo los ganchos aquí para desactivarlos y " +"eliminar su configuración." #: components/points/admin/screens/hooks.php:144 msgid "" "Drag hooks here to remove them from the points type but keep their settings." msgstr "" -"Arrastre ganchos aquí para eliminarlos del tipo de puntos, pero conservar " -"sus ajustes" +"Arrastre los ganchos aquí para eliminarlos del tipo de puntos, pero " +"conservar sus ajustes." #: components/points/admin/screens/hooks.php:208 msgid "Add New Points Type" @@ -987,15 +996,15 @@ msgstr "WordPoints- Informes de Red de Puntos" #: components/points/admin/screens/logs.php:20 msgid "View recent points transactions." -msgstr "Ver transacciones de puntos recientes" +msgstr "Ver transacciones de puntos recientes." #: components/points/admin/screens/logs.php:35 msgid "" "You need to create a type of points before you can use " "this page." msgstr "" -"Necesita crear un tipo de puntos antes de poder " -"utilizar esta página" +"Necesita crear un tipo de puntos antes de poder utilizar " +"esta página." #: components/points/includes/class-wordpoints-points-hook.php:789 msgid "Points:" @@ -1005,67 +1014,67 @@ msgstr "Puntos:" msgid "There are no points hooks currently available." msgstr "No hay ganchos de puntos disponibles en la actualidad." -#: components/points/includes/class-wordpoints-points-hooks.php:582 +#: components/points/includes/class-wordpoints-points-hooks.php:584 msgid "Settings" msgstr "Ajustes" -#: components/points/includes/class-wordpoints-points-hooks.php:594 +#: components/points/includes/class-wordpoints-points-hooks.php:596 msgid "Slug" msgstr "Slug" -#: components/points/includes/class-wordpoints-points-hooks.php:613 +#: components/points/includes/class-wordpoints-points-hooks.php:615 msgctxt "points type" msgid "Prefix (optional):" msgstr "Prefijo (opcional):" -#: components/points/includes/class-wordpoints-points-hooks.php:614 +#: components/points/includes/class-wordpoints-points-hooks.php:616 msgctxt "points type" msgid "Suffix (optional):" msgstr "Sufijo (opcional):" -#: components/points/includes/class-wordpoints-points-hooks.php:618 +#: components/points/includes/class-wordpoints-points-hooks.php:620 msgctxt "points type" msgid "Prefix:" msgstr "Prefijo:" -#: components/points/includes/class-wordpoints-points-hooks.php:619 +#: components/points/includes/class-wordpoints-points-hooks.php:621 msgctxt "points type" msgid "Suffix:" msgstr "Sufijo:" -#: components/points/includes/class-wordpoints-points-hooks.php:625 +#: components/points/includes/class-wordpoints-points-hooks.php:627 msgctxt "points type" msgid "Name:" msgstr "Nombre:" -#: components/points/includes/class-wordpoints-points-hooks.php:664 +#: components/points/includes/class-wordpoints-points-hooks.php:666 msgctxt "points type" msgid "Delete" msgstr "Borrar" -#: components/points/includes/class-wordpoints-points-hooks.php:668 -#: components/points/includes/class-wordpoints-points-hooks.php:774 +#: components/points/includes/class-wordpoints-points-hooks.php:670 +#: components/points/includes/class-wordpoints-points-hooks.php:776 #: components/ranks/admin/screens/ranks.php:100 #: components/ranks/admin/screens/ranks.php:126 msgid "Close" msgstr "Cerrar" -#: components/points/includes/class-wordpoints-points-hooks.php:671 +#: components/points/includes/class-wordpoints-points-hooks.php:673 msgctxt "points type" msgid "Save" msgstr "Guardar" -#: components/points/includes/class-wordpoints-points-hooks.php:749 +#: components/points/includes/class-wordpoints-points-hooks.php:751 msgctxt "hook" msgid "Edit" msgstr "Editar" -#: components/points/includes/class-wordpoints-points-hooks.php:750 +#: components/points/includes/class-wordpoints-points-hooks.php:752 msgctxt "hook" msgid "Add" msgstr "Añadir" -#: components/points/includes/class-wordpoints-points-hooks.php:777 +#: components/points/includes/class-wordpoints-points-hooks.php:779 #: components/ranks/admin/screens/ranks.php:124 msgid "Save" msgstr "Guardar" @@ -1085,12 +1094,12 @@ msgstr "" "cambios realizados por el mismo. Sólo las transacciones realizadas por " "WordPoints se incluyen en los registros." -#: components/points/includes/hooks/abstracts/post-type.php:240 +#: components/points/includes/hooks/abstracts/post-type.php:239 msgctxt "post title" msgid "(no title)" msgstr "(sin título)" -#: components/points/includes/hooks/abstracts/post-type.php:296 +#: components/points/includes/hooks/abstracts/post-type.php:295 msgid "Select post type:" msgstr "Seleccione el tipo de mensaje:" @@ -1158,7 +1167,7 @@ msgstr "Comentario Eliminado" #: components/points/includes/hooks/comment-removed.php:46 msgid "Comment removed from the site." -msgstr "Comentario eliminado del sitio" +msgstr "Comentario eliminado del sitio." #. translators: the post type name. #: components/points/includes/hooks/comment-removed.php:48 @@ -1225,78 +1234,78 @@ msgstr "Comentario en un %s eliminado del sitio." msgid "Revoke the points if the comment is removed." msgstr "" -#: components/points/includes/hooks/periodic.php:42 +#: components/points/includes/hooks/periodic.php:43 msgctxt "points hook name" msgid "Periodic Points" msgstr "Puntos periódicos" -#: components/points/includes/hooks/periodic.php:42 +#: components/points/includes/hooks/periodic.php:44 msgid "Visiting the site at least once in a given time period." msgstr "Visitar el sitio por lo menos una vez en un período de tiempo dado." -#: components/points/includes/hooks/periodic.php:134 +#: components/points/includes/hooks/periodic.php:137 msgctxt "points log description" msgid "Hourly points." msgstr "Puntos por hora." -#: components/points/includes/hooks/periodic.php:138 +#: components/points/includes/hooks/periodic.php:141 msgctxt "points log description" msgid "Daily points." msgstr "Puntos diarios." -#: components/points/includes/hooks/periodic.php:142 +#: components/points/includes/hooks/periodic.php:145 msgctxt "points log description" msgid "Weekly points." msgstr "Puntos semanales." -#: components/points/includes/hooks/periodic.php:146 +#: components/points/includes/hooks/periodic.php:149 msgctxt "points log description" msgid "Monthly points." msgstr "Puntos mensuales." -#: components/points/includes/hooks/periodic.php:150 +#: components/points/includes/hooks/periodic.php:153 msgctxt "points log description" msgid "Periodic points." msgstr "Puntos periódicos." -#: components/points/includes/hooks/periodic.php:172 +#: components/points/includes/hooks/periodic.php:175 msgid "Visiting the site at least once in an hour." msgstr "Visitar el sitio al menos una vez en una hora." -#: components/points/includes/hooks/periodic.php:175 +#: components/points/includes/hooks/periodic.php:178 msgid "Visiting the site at least once in a day." msgstr "Visitar el sitio por lo menos una vez al día." -#: components/points/includes/hooks/periodic.php:178 +#: components/points/includes/hooks/periodic.php:181 msgid "Visiting the site at least once in a week." msgstr "Visitar el sitio al menos una vez en una semana." -#: components/points/includes/hooks/periodic.php:181 +#: components/points/includes/hooks/periodic.php:184 msgid "Visiting the site at least once in a month." msgstr "Visitar el sitio al menos una vez en un mes." -#: components/points/includes/hooks/periodic.php:184 +#: components/points/includes/hooks/periodic.php:187 msgid "Visiting the site periodically." msgstr "Visitar periódicamente el sitio." -#: components/points/includes/hooks/periodic.php:238 +#: components/points/includes/hooks/periodic.php:241 msgctxt "length of time" msgid "Period:" msgstr "Período:" -#: components/points/includes/hooks/periodic.php:259 +#: components/points/includes/hooks/periodic.php:262 msgid "hourly" msgstr "cada hora" -#: components/points/includes/hooks/periodic.php:260 +#: components/points/includes/hooks/periodic.php:263 msgid "daily" msgstr "Diaria" -#: components/points/includes/hooks/periodic.php:261 +#: components/points/includes/hooks/periodic.php:264 msgid "weekly" msgstr "Semanal" -#: components/points/includes/hooks/periodic.php:262 +#: components/points/includes/hooks/periodic.php:265 msgid "monthly" msgstr "Mensual" @@ -1316,7 +1325,7 @@ msgstr "Puntos removidos cuando se eliminan:" #. translators: the post type name. #: components/points/includes/hooks/post-delete.php:51 msgid "%s permanently deleted." -msgstr "%s eliminado permanentemente" +msgstr "%s eliminado permanentemente." #: components/points/includes/hooks/post-delete.php:79 msgid "Auto Draft" @@ -1334,13 +1343,13 @@ msgstr "Nuevo mensaje publicado." #. translators: the post type name. #: components/points/includes/hooks/post.php:57 msgid "New %s published." -msgstr "Nuevos %s publicados" +msgstr "Nuevos %s publicados." #. translators: %s will be a link to the post. #: components/points/includes/hooks/post.php:59 msgctxt "points log description" msgid "Post %s published." -msgstr "Publicación %s publicada" +msgstr "Publicación %s añadida." #. translators: 1 is the post type name, 2 is a link to the post. #: components/points/includes/hooks/post.php:61 @@ -1361,7 +1370,9 @@ msgid "Post published." msgstr "Mensaje publicado." #. translators: %s is the name of a post type. +#. translators: the post type's name. #: components/points/includes/hooks/post.php:66 +#: components/points/includes/logs.php:703 #, fuzzy msgctxt "points log description" msgid "%s deleted." @@ -1369,19 +1380,18 @@ msgstr "%s eliminado permanentemente" #. translators: 1 is the post type name, 2 is the post title. #: components/points/includes/hooks/post.php:68 -#: components/points/includes/logs.php:703 msgctxt "points log description" msgid "%1$s “%2$s” deleted." msgstr "%1$s “%2$s”eliminado." #. translators: %s will be the post title. #: components/points/includes/hooks/post.php:70 -#: components/points/includes/logs.php:712 msgctxt "points log description" msgid "Post “%s” deleted." msgstr "Mensaje “%s” eliminado." #: components/points/includes/hooks/post.php:71 +#: components/points/includes/logs.php:709 #, fuzzy msgctxt "points log description" msgid "Post deleted." @@ -1442,7 +1452,7 @@ msgstr "Buscar:." msgid "Search Logs" msgstr "Buscar:." -#: components/points/includes/logs.php:519 +#: components/points/includes/logs.php:509 #, fuzzy msgid "No matching logs found." msgstr "No se encontrarn registros coincidentes" @@ -1455,36 +1465,36 @@ msgstr "Puntos ajustado por %s. Motivo: %s" #: components/points/includes/logs.php:673 msgctxt "points log description" msgid "Comment marked as spam." -msgstr "Comentario marcados como spam" +msgstr "Comentario marcado como spam." #: components/points/includes/logs.php:677 msgctxt "points log description" msgid "Comment moved to trash." -msgstr "Comentario movido a la papelera" +msgstr "Comentario movido a la papelera." #: components/points/includes/logs.php:681 msgctxt "points log description" msgid "Comment unapproved." msgstr "Comentario no aprobado." -#: components/points/includes/points.php:963 +#: components/points/includes/points.php:954 msgctxt "points log" msgid "(no description)" msgstr "(sin descripción)" -#: components/points/includes/points.php:1122 +#: components/points/includes/points.php:1114 #, fuzzy msgctxt "top users table heading" msgid "Position" msgstr "Descripción" -#: components/points/includes/points.php:1123 +#: components/points/includes/points.php:1115 #, fuzzy msgctxt "top users table heading" msgid "User" msgstr "Usuario" -#: components/points/includes/points.php:1124 +#: components/points/includes/points.php:1116 #, fuzzy msgctxt "top users table heading" msgid "Points" @@ -1557,7 +1567,7 @@ msgstr "Debes estar registrado para ver los puntos." #: components/points/includes/widgets.php:542 msgctxt "form label" msgid "Title" -msgstr "Título:" +msgstr "Título" #: components/points/includes/widgets.php:269 msgid "Points type to display" @@ -1569,7 +1579,7 @@ msgstr "Texto del Widget" #: components/points/includes/widgets.php:276 msgid "%s will be replaced with the points of the logged in user" -msgstr "%s será reemplazado con los puntos del usuario en sesión." +msgstr "%s será reemplazado con los puntos del usuario en sesión" #: components/points/includes/widgets.php:291 msgid "Text if the user is not logged in" @@ -1867,91 +1877,91 @@ msgstr "" "El componente “%s” no pudo ser desactivado. Por favor, inténtelo " "de nuevo." -#: includes/class-wordpoints-components.php:546 +#: includes/class-wordpoints-components.php:564 msgid "" "WordPoints detected a large network and has skipped part of the installation " "process for the “%s” component." msgstr "" -#: includes/class-wordpoints-components.php:549 +#: includes/class-wordpoints-components.php:567 msgid "" "WordPoints detected a large network and has skipped part of the update " "process for the “%s” component for version %s (and possibly " "later versions)." msgstr "" -#: includes/class-wordpoints-components.php:555 +#: includes/class-wordpoints-components.php:573 msgid "" "The rest of the process needs to be completed manually. If this has not been " "done already, some parts of the component may not function properly." msgstr "" -#: includes/functions.php:525 +#: includes/functions.php:576 msgctxt "post type" msgid "Any" msgstr "Cualquiera" -#: includes/functions.php:623 +#: includes/functions.php:676 msgid "Shortcode error:" -msgstr "error Código corto" +msgstr "Error de código corto:" -#: includes/functions.php:762 +#: includes/functions.php:815 msgctxt "component name" msgid "Points" msgstr "Puntos" -#: includes/functions.php:764 includes/functions.php:789 +#: includes/functions.php:817 includes/functions.php:842 msgctxt "component author" msgid "WordPoints" msgstr "WordPoints" -#: includes/functions.php:767 +#: includes/functions.php:820 msgid "Enables a points system for your site." msgstr "Permite un sistema de puntos para su sitio." -#: includes/functions.php:787 +#: includes/functions.php:840 msgctxt "component name" msgid "Ranks" msgstr "" -#: includes/functions.php:792 +#: includes/functions.php:845 msgid "Assign users ranks based on their points levels." msgstr "" -#: includes/modules.php:473 +#: includes/modules.php:479 msgid "By %s." -msgstr "Por %s" +msgstr "Por %s." -#: includes/modules.php:632 +#: includes/modules.php:638 msgid "Invalid module path." -msgstr "Ruta del módulo no válida" +msgstr "Ruta del módulo no válida." -#: includes/modules.php:636 +#: includes/modules.php:642 msgid "Module file does not exist." -msgstr "Archivo de módulo no existe" +msgstr "Archivo de módulo no existe." -#: includes/modules.php:642 +#: includes/modules.php:648 msgid "The module does not have a valid header." msgstr "El módulo no tiene una cabecera válida." -#: includes/modules.php:823 +#: includes/modules.php:829 msgid "The module generated unexpected output." -msgstr "El módulo generó una salida inesperada" +msgstr "El módulo generó una salida inesperada." -#: includes/modules.php:1000 +#: includes/modules.php:1006 msgid "Could not access filesystem." msgstr "No se pudo acceder al sistema de archivos." -#: includes/modules.php:1004 +#: includes/modules.php:1010 msgid "Filesystem error." msgstr "Error del sistema de archivos." -#: includes/modules.php:1011 +#: includes/modules.php:1017 msgid "Unable to locate WordPoints Module directory." msgstr "No se puede localizar el directorio de Módulos WordPoints." #. translators: A module or list of modules. -#: includes/modules.php:1057 +#: includes/modules.php:1063 #, fuzzy msgid "Could not fully remove the module %s." msgid_plural "Could not fully remove the modules %s." @@ -1967,7 +1977,7 @@ msgid "" "Create one or more points systems for your site, and reward user activity." msgstr "" "Cree uno o más sistemas de puntos para su sitio, y recompense la actividad " -"del usuario" +"del usuario." #. Author of the plugin/theme msgid "J.D. Grimes" diff --git a/src/languages/wordpoints-ja.mo b/src/languages/wordpoints-ja.mo index 27e736c9..51e05394 100644 Binary files a/src/languages/wordpoints-ja.mo and b/src/languages/wordpoints-ja.mo differ diff --git a/src/languages/wordpoints-ja.po b/src/languages/wordpoints-ja.po index 13d4b0cd..a475836f 100644 --- a/src/languages/wordpoints-ja.po +++ b/src/languages/wordpoints-ja.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: WordPoints 1.6.0\n" "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/wordpoints\n" -"POT-Creation-Date: 2015-01-30 22:50:22+00:00\n" +"POT-Creation-Date: 2015-02-27 21:33:55+00:00\n" "PO-Revision-Date: 2014-10-26 03:07+0200\n" "Last-Translator: Raymond Calla \n" "Language-Team: Japanese 五つ星の評価をつけてください。" -#: admin/admin.php:502 +#: admin/admin.php:514 msgid "" "If you don’t think this plugin deserves 5 stars, please let us know " "how we can improve it." msgstr "" -#: admin/admin.php:505 +#: admin/admin.php:517 msgid "Need help?" msgstr "" -#: admin/admin.php:506 +#: admin/admin.php:518 msgid "" "Post your feature request or support question in the support " "forums" msgstr "" -#: admin/admin.php:507 +#: admin/admin.php:519 msgid "Thank you for using WordPoints!" msgstr "" -#: admin/admin.php:540 +#: admin/admin.php:552 msgid "" "WordPoints detected a large network and has skipped part of the installation " "process." msgstr "" -#: admin/admin.php:543 +#: admin/admin.php:555 msgid "" "WordPoints detected a large network and has skipped part of the update " "process for version %s (and possibly later versions)." msgstr "" -#: admin/admin.php:549 +#: admin/admin.php:561 msgid "" "The rest of the process needs to be completed manually. If this has not been " "done already, some parts of the plugin may not function properly." msgstr "" -#: admin/admin.php:550 includes/class-wordpoints-components.php:556 +#: admin/admin.php:562 includes/class-wordpoints-components.php:574 msgid "Learn more." msgstr "" @@ -244,7 +244,7 @@ msgstr[0] "" #: admin/includes/class-wordpoints-modules-list-table.php:427 #: admin/includes/class-wordpoints-modules-list-table.php:722 -#: admin/screens/configure-components.php:115 +#: admin/screens/configure-components.php:108 msgid "Activate" msgstr "" @@ -255,7 +255,7 @@ msgstr "" #: admin/includes/class-wordpoints-modules-list-table.php:431 #: admin/includes/class-wordpoints-modules-list-table.php:718 -#: admin/screens/configure-components.php:110 +#: admin/screens/configure-components.php:103 msgid "Deactivate" msgstr "" @@ -263,7 +263,7 @@ msgstr "" #: admin/includes/class-wordpoints-modules-list-table.php:710 #: admin/includes/class-wordpoints-modules-list-table.php:725 #: components/points/admin/admin.php:54 -#: components/points/includes/class-wordpoints-points-hooks.php:773 +#: components/points/includes/class-wordpoints-points-hooks.php:775 #: components/ranks/admin/admin.php:53 #: components/ranks/admin/screens/ranks.php:128 msgid "Delete" @@ -283,7 +283,7 @@ msgstr "" #. translators: %s is the component author's name. #: admin/includes/class-wordpoints-modules-list-table.php:591 -#: admin/screens/configure-components.php:136 +#: admin/screens/configure-components.php:129 msgid "By %s" msgstr "" @@ -314,25 +314,25 @@ msgid "Installed WordPoints components." msgstr "" #: admin/screens/configure-components.php:88 -#: admin/screens/configure-components.php:96 +#: admin/screens/configure-components.php:156 msgctxt "components table heading" msgid "Component" msgstr "" #: admin/screens/configure-components.php:89 -#: admin/screens/configure-components.php:97 +#: admin/screens/configure-components.php:157 msgctxt "components table heading" msgid "Description" msgstr "" #: admin/screens/configure-components.php:90 -#: admin/screens/configure-components.php:98 +#: admin/screens/configure-components.php:158 msgctxt "components table heading" msgid "Version" msgstr "" #: admin/screens/configure-components.php:91 -#: admin/screens/configure-components.php:99 +#: admin/screens/configure-components.php:159 msgctxt "components table heading" msgid "Action" msgstr "" @@ -897,67 +897,67 @@ msgstr "" msgid "There are no points hooks currently available." msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:582 +#: components/points/includes/class-wordpoints-points-hooks.php:584 msgid "Settings" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:594 +#: components/points/includes/class-wordpoints-points-hooks.php:596 msgid "Slug" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:613 +#: components/points/includes/class-wordpoints-points-hooks.php:615 msgctxt "points type" msgid "Prefix (optional):" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:614 +#: components/points/includes/class-wordpoints-points-hooks.php:616 msgctxt "points type" msgid "Suffix (optional):" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:618 +#: components/points/includes/class-wordpoints-points-hooks.php:620 msgctxt "points type" msgid "Prefix:" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:619 +#: components/points/includes/class-wordpoints-points-hooks.php:621 msgctxt "points type" msgid "Suffix:" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:625 +#: components/points/includes/class-wordpoints-points-hooks.php:627 msgctxt "points type" msgid "Name:" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:664 +#: components/points/includes/class-wordpoints-points-hooks.php:666 msgctxt "points type" msgid "Delete" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:668 -#: components/points/includes/class-wordpoints-points-hooks.php:774 +#: components/points/includes/class-wordpoints-points-hooks.php:670 +#: components/points/includes/class-wordpoints-points-hooks.php:776 #: components/ranks/admin/screens/ranks.php:100 #: components/ranks/admin/screens/ranks.php:126 msgid "Close" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:671 +#: components/points/includes/class-wordpoints-points-hooks.php:673 msgctxt "points type" msgid "Save" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:749 +#: components/points/includes/class-wordpoints-points-hooks.php:751 msgctxt "hook" msgid "Edit" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:750 +#: components/points/includes/class-wordpoints-points-hooks.php:752 msgctxt "hook" msgid "Add" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:777 +#: components/points/includes/class-wordpoints-points-hooks.php:779 #: components/ranks/admin/screens/ranks.php:124 msgid "Save" msgstr "" @@ -973,12 +973,12 @@ msgid "" "transactions performed by WordPoints are included in the logs." msgstr "" -#: components/points/includes/hooks/abstracts/post-type.php:240 +#: components/points/includes/hooks/abstracts/post-type.php:239 msgctxt "post title" msgid "(no title)" msgstr "" -#: components/points/includes/hooks/abstracts/post-type.php:296 +#: components/points/includes/hooks/abstracts/post-type.php:295 msgid "Select post type:" msgstr "" @@ -1100,78 +1100,78 @@ msgstr "" msgid "Revoke the points if the comment is removed." msgstr "" -#: components/points/includes/hooks/periodic.php:42 +#: components/points/includes/hooks/periodic.php:43 msgctxt "points hook name" msgid "Periodic Points" msgstr "" -#: components/points/includes/hooks/periodic.php:42 +#: components/points/includes/hooks/periodic.php:44 msgid "Visiting the site at least once in a given time period." msgstr "" -#: components/points/includes/hooks/periodic.php:134 +#: components/points/includes/hooks/periodic.php:137 msgctxt "points log description" msgid "Hourly points." msgstr "" -#: components/points/includes/hooks/periodic.php:138 +#: components/points/includes/hooks/periodic.php:141 msgctxt "points log description" msgid "Daily points." msgstr "" -#: components/points/includes/hooks/periodic.php:142 +#: components/points/includes/hooks/periodic.php:145 msgctxt "points log description" msgid "Weekly points." msgstr "" -#: components/points/includes/hooks/periodic.php:146 +#: components/points/includes/hooks/periodic.php:149 msgctxt "points log description" msgid "Monthly points." msgstr "" -#: components/points/includes/hooks/periodic.php:150 +#: components/points/includes/hooks/periodic.php:153 msgctxt "points log description" msgid "Periodic points." msgstr "" -#: components/points/includes/hooks/periodic.php:172 +#: components/points/includes/hooks/periodic.php:175 msgid "Visiting the site at least once in an hour." msgstr "" -#: components/points/includes/hooks/periodic.php:175 +#: components/points/includes/hooks/periodic.php:178 msgid "Visiting the site at least once in a day." msgstr "" -#: components/points/includes/hooks/periodic.php:178 +#: components/points/includes/hooks/periodic.php:181 msgid "Visiting the site at least once in a week." msgstr "" -#: components/points/includes/hooks/periodic.php:181 +#: components/points/includes/hooks/periodic.php:184 msgid "Visiting the site at least once in a month." msgstr "" -#: components/points/includes/hooks/periodic.php:184 +#: components/points/includes/hooks/periodic.php:187 msgid "Visiting the site periodically." msgstr "" -#: components/points/includes/hooks/periodic.php:238 +#: components/points/includes/hooks/periodic.php:241 msgctxt "length of time" msgid "Period:" msgstr "" -#: components/points/includes/hooks/periodic.php:259 +#: components/points/includes/hooks/periodic.php:262 msgid "hourly" msgstr "" -#: components/points/includes/hooks/periodic.php:260 +#: components/points/includes/hooks/periodic.php:263 msgid "daily" msgstr "" -#: components/points/includes/hooks/periodic.php:261 +#: components/points/includes/hooks/periodic.php:264 msgid "weekly" msgstr "" -#: components/points/includes/hooks/periodic.php:262 +#: components/points/includes/hooks/periodic.php:265 msgid "monthly" msgstr "" @@ -1235,26 +1235,27 @@ msgid "Post published." msgstr "" #. translators: %s is the name of a post type. +#. translators: the post type's name. #: components/points/includes/hooks/post.php:66 +#: components/points/includes/logs.php:703 msgctxt "points log description" msgid "%s deleted." msgstr "" #. translators: 1 is the post type name, 2 is the post title. #: components/points/includes/hooks/post.php:68 -#: components/points/includes/logs.php:703 msgctxt "points log description" msgid "%1$s “%2$s” deleted." msgstr "" #. translators: %s will be the post title. #: components/points/includes/hooks/post.php:70 -#: components/points/includes/logs.php:712 msgctxt "points log description" msgid "Post “%s” deleted." msgstr "" #: components/points/includes/hooks/post.php:71 +#: components/points/includes/logs.php:709 msgctxt "points log description" msgid "Post deleted." msgstr "" @@ -1310,7 +1311,7 @@ msgstr "" msgid "Search Logs" msgstr "" -#: components/points/includes/logs.php:519 +#: components/points/includes/logs.php:509 msgid "No matching logs found." msgstr "" @@ -1334,22 +1335,22 @@ msgctxt "points log description" msgid "Comment unapproved." msgstr "" -#: components/points/includes/points.php:963 +#: components/points/includes/points.php:954 msgctxt "points log" msgid "(no description)" msgstr "" -#: components/points/includes/points.php:1122 +#: components/points/includes/points.php:1114 msgctxt "top users table heading" msgid "Position" msgstr "" -#: components/points/includes/points.php:1123 +#: components/points/includes/points.php:1115 msgctxt "top users table heading" msgid "User" msgstr "" -#: components/points/includes/points.php:1124 +#: components/points/includes/points.php:1116 #, fuzzy msgctxt "top users table heading" msgid "Points" @@ -1698,91 +1699,91 @@ msgid "" "%2$s" msgstr "" -#: includes/class-wordpoints-components.php:546 +#: includes/class-wordpoints-components.php:564 msgid "" "WordPoints detected a large network and has skipped part of the installation " "process for the “%s” component." msgstr "" -#: includes/class-wordpoints-components.php:549 +#: includes/class-wordpoints-components.php:567 msgid "" "WordPoints detected a large network and has skipped part of the update " "process for the “%s” component for version %s (and possibly " "later versions)." msgstr "" -#: includes/class-wordpoints-components.php:555 +#: includes/class-wordpoints-components.php:573 msgid "" "The rest of the process needs to be completed manually. If this has not been " "done already, some parts of the component may not function properly." msgstr "" -#: includes/functions.php:525 +#: includes/functions.php:576 msgctxt "post type" msgid "Any" msgstr "" -#: includes/functions.php:623 +#: includes/functions.php:676 msgid "Shortcode error:" msgstr "" -#: includes/functions.php:762 +#: includes/functions.php:815 msgctxt "component name" msgid "Points" msgstr "" -#: includes/functions.php:764 includes/functions.php:789 +#: includes/functions.php:817 includes/functions.php:842 msgctxt "component author" msgid "WordPoints" msgstr "" -#: includes/functions.php:767 +#: includes/functions.php:820 msgid "Enables a points system for your site." msgstr "" -#: includes/functions.php:787 +#: includes/functions.php:840 msgctxt "component name" msgid "Ranks" msgstr "" -#: includes/functions.php:792 +#: includes/functions.php:845 msgid "Assign users ranks based on their points levels." msgstr "" -#: includes/modules.php:473 +#: includes/modules.php:479 msgid "By %s." msgstr "" -#: includes/modules.php:632 +#: includes/modules.php:638 msgid "Invalid module path." msgstr "" -#: includes/modules.php:636 +#: includes/modules.php:642 msgid "Module file does not exist." msgstr "" -#: includes/modules.php:642 +#: includes/modules.php:648 msgid "The module does not have a valid header." msgstr "" -#: includes/modules.php:823 +#: includes/modules.php:829 msgid "The module generated unexpected output." msgstr "" -#: includes/modules.php:1000 +#: includes/modules.php:1006 msgid "Could not access filesystem." msgstr "" -#: includes/modules.php:1004 +#: includes/modules.php:1010 msgid "Filesystem error." msgstr "" -#: includes/modules.php:1011 +#: includes/modules.php:1017 msgid "Unable to locate WordPoints Module directory." msgstr "" #. translators: A module or list of modules. -#: includes/modules.php:1057 +#: includes/modules.php:1063 msgid "Could not fully remove the module %s." msgid_plural "Could not fully remove the modules %s." msgstr[0] "" diff --git a/src/languages/wordpoints-pt_BR.mo b/src/languages/wordpoints-pt_BR.mo index 32dc9cec..f41ec179 100644 Binary files a/src/languages/wordpoints-pt_BR.mo and b/src/languages/wordpoints-pt_BR.mo differ diff --git a/src/languages/wordpoints-pt_BR.po b/src/languages/wordpoints-pt_BR.po index 640a3029..17432545 100644 --- a/src/languages/wordpoints-pt_BR.po +++ b/src/languages/wordpoints-pt_BR.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: WordPoints_pt_BR\n" "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/wordpoints\n" -"POT-Creation-Date: 2015-01-30 22:50:22+00:00\n" +"POT-Creation-Date: 2015-02-27 21:33:55+00:00\n" "PO-Revision-Date: 2013-12-21 02:20-0300\n" "Last-Translator: Gabriel Galvão \n" "Language-Team: Gabriel Galvão \n" @@ -14,7 +14,7 @@ msgstr "" "X-Poedit-Basepath: .\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. #-#-#-#-# wordpoints.pot (WordPoints 1.9.0) #-#-#-#-# +#. #-#-#-#-# wordpoints.pot (WordPoints 1.10.0) #-#-#-#-# #. Plugin Name of the plugin/theme #: admin/admin.php:67 components/points/admin/admin.php:280 #: components/points/includes/widgets.php:120 @@ -48,34 +48,34 @@ msgstr "WordPoints - Instalar Modulos" msgid "Install Modules" msgstr "Instalar Modulos" -#: admin/admin.php:281 +#: admin/admin.php:293 msgid "Hide This Notice" msgstr "" -#: admin/admin.php:334 +#: admin/admin.php:346 #, fuzzy msgid "WordPoints — %s" msgstr "WordPoints - %s" -#: admin/admin.php:364 +#: admin/admin.php:376 msgid "Install a module in .zip format" msgstr "Instalar um modulo no formato .zip" -#: admin/admin.php:365 +#: admin/admin.php:377 msgid "" "If you have a module in a .zip format, you may install it by uploading it " "here." msgstr "Se você tem um modulo no formato .zip, você pode instalá-lo aqui." -#: admin/admin.php:368 +#: admin/admin.php:380 msgid "Module zip file" msgstr "Arquivo .zip do Modulo" -#: admin/admin.php:370 +#: admin/admin.php:382 msgid "Install Now" msgstr "Instalar Agora" -#: admin/admin.php:387 +#: admin/admin.php:399 msgid "" "You do not have sufficient permissions to install WordPoints modules on this " "site." @@ -83,25 +83,25 @@ msgstr "" "Você não tem permissões suficientes para instalar modulos WordPoints neste " "site." -#: admin/admin.php:394 +#: admin/admin.php:406 msgid "Upload WordPoints Module" msgstr "Faça upload do Modulo WordPoints" -#: admin/admin.php:406 +#: admin/admin.php:418 msgid "Installing Module from uploaded file: %s" msgstr "Instalando Modulo do arquivo: %s" -#: admin/admin.php:470 +#: admin/admin.php:482 msgid "" "This appears to be a WordPoints module archive. Try installing it on the " "WordPoints module install screen instead." msgstr "" -#: admin/admin.php:500 +#: admin/admin.php:512 msgid "Like this plugin?" msgstr "Gostou desse plugin?" -#: admin/admin.php:501 +#: admin/admin.php:513 msgid "" "If you think WordPoints is great, let everyone know by giving it a 5 star rating." @@ -109,7 +109,7 @@ msgstr "" "Se você acha que WordPoints é incrível, deixe todos saberem dando a ele 5 estrelas." -#: admin/admin.php:502 +#: admin/admin.php:514 msgid "" "If you don’t think this plugin deserves 5 stars, please let us know " "how we can improve it." @@ -117,39 +117,39 @@ msgstr "" "Se você não acredita que este plugin merece 5 estrelas, por favor deixe-nos " "saber como podemos melhorá-lo." -#: admin/admin.php:505 +#: admin/admin.php:517 msgid "Need help?" msgstr "Precisa de Ajuda?" -#: admin/admin.php:506 +#: admin/admin.php:518 msgid "" "Post your feature request or support question in the support " "forums" msgstr "Poste sua melhoria ou dúvida no Fórum de Suporte" -#: admin/admin.php:507 +#: admin/admin.php:519 msgid "Thank you for using WordPoints!" msgstr "Obrigado por usar WordPoints!" -#: admin/admin.php:540 +#: admin/admin.php:552 msgid "" "WordPoints detected a large network and has skipped part of the installation " "process." msgstr "" -#: admin/admin.php:543 +#: admin/admin.php:555 msgid "" "WordPoints detected a large network and has skipped part of the update " "process for version %s (and possibly later versions)." msgstr "" -#: admin/admin.php:549 +#: admin/admin.php:561 msgid "" "The rest of the process needs to be completed manually. If this has not been " "done already, some parts of the plugin may not function properly." msgstr "" -#: admin/admin.php:550 includes/class-wordpoints-components.php:556 +#: admin/admin.php:562 includes/class-wordpoints-components.php:574 msgid "Learn more." msgstr "" @@ -247,7 +247,7 @@ msgstr[1] "Inativos (%s)" #: admin/includes/class-wordpoints-modules-list-table.php:427 #: admin/includes/class-wordpoints-modules-list-table.php:722 -#: admin/screens/configure-components.php:115 +#: admin/screens/configure-components.php:108 msgid "Activate" msgstr "Ativar" @@ -258,7 +258,7 @@ msgstr "Desativar Network" #: admin/includes/class-wordpoints-modules-list-table.php:431 #: admin/includes/class-wordpoints-modules-list-table.php:718 -#: admin/screens/configure-components.php:110 +#: admin/screens/configure-components.php:103 msgid "Deactivate" msgstr "Desativar" @@ -266,7 +266,7 @@ msgstr "Desativar" #: admin/includes/class-wordpoints-modules-list-table.php:710 #: admin/includes/class-wordpoints-modules-list-table.php:725 #: components/points/admin/admin.php:54 -#: components/points/includes/class-wordpoints-points-hooks.php:773 +#: components/points/includes/class-wordpoints-points-hooks.php:775 #: components/ranks/admin/admin.php:53 #: components/ranks/admin/screens/ranks.php:128 msgid "Delete" @@ -286,7 +286,7 @@ msgstr "Versão %s" #. translators: %s is the component author's name. #: admin/includes/class-wordpoints-modules-list-table.php:591 -#: admin/screens/configure-components.php:136 +#: admin/screens/configure-components.php:129 msgid "By %s" msgstr "Por %s" @@ -323,25 +323,25 @@ msgid "Installed WordPoints components." msgstr "Ver componentes WordPoint instalados." #: admin/screens/configure-components.php:88 -#: admin/screens/configure-components.php:96 +#: admin/screens/configure-components.php:156 msgctxt "components table heading" msgid "Component" msgstr "Componente" #: admin/screens/configure-components.php:89 -#: admin/screens/configure-components.php:97 +#: admin/screens/configure-components.php:157 msgctxt "components table heading" msgid "Description" msgstr "Descrição" #: admin/screens/configure-components.php:90 -#: admin/screens/configure-components.php:98 +#: admin/screens/configure-components.php:158 msgctxt "components table heading" msgid "Version" msgstr "Versão" #: admin/screens/configure-components.php:91 -#: admin/screens/configure-components.php:99 +#: admin/screens/configure-components.php:159 msgctxt "components table heading" msgid "Action" msgstr "Ações" @@ -991,67 +991,67 @@ msgstr "Pontos:" msgid "There are no points hooks currently available." msgstr "Não há ligações disponíveis atualmente." -#: components/points/includes/class-wordpoints-points-hooks.php:582 +#: components/points/includes/class-wordpoints-points-hooks.php:584 msgid "Settings" msgstr "Configurações" -#: components/points/includes/class-wordpoints-points-hooks.php:594 +#: components/points/includes/class-wordpoints-points-hooks.php:596 msgid "Slug" msgstr "Slug" -#: components/points/includes/class-wordpoints-points-hooks.php:613 +#: components/points/includes/class-wordpoints-points-hooks.php:615 msgctxt "points type" msgid "Prefix (optional):" msgstr "Prefixo (opcional):" -#: components/points/includes/class-wordpoints-points-hooks.php:614 +#: components/points/includes/class-wordpoints-points-hooks.php:616 msgctxt "points type" msgid "Suffix (optional):" msgstr "Sufixo (opcional):" -#: components/points/includes/class-wordpoints-points-hooks.php:618 +#: components/points/includes/class-wordpoints-points-hooks.php:620 msgctxt "points type" msgid "Prefix:" msgstr "Prefixo:" -#: components/points/includes/class-wordpoints-points-hooks.php:619 +#: components/points/includes/class-wordpoints-points-hooks.php:621 msgctxt "points type" msgid "Suffix:" msgstr "Sufixo:" -#: components/points/includes/class-wordpoints-points-hooks.php:625 +#: components/points/includes/class-wordpoints-points-hooks.php:627 msgctxt "points type" msgid "Name:" msgstr "Nome:" -#: components/points/includes/class-wordpoints-points-hooks.php:664 +#: components/points/includes/class-wordpoints-points-hooks.php:666 msgctxt "points type" msgid "Delete" msgstr "Deletar" -#: components/points/includes/class-wordpoints-points-hooks.php:668 -#: components/points/includes/class-wordpoints-points-hooks.php:774 +#: components/points/includes/class-wordpoints-points-hooks.php:670 +#: components/points/includes/class-wordpoints-points-hooks.php:776 #: components/ranks/admin/screens/ranks.php:100 #: components/ranks/admin/screens/ranks.php:126 msgid "Close" msgstr "Fechar" -#: components/points/includes/class-wordpoints-points-hooks.php:671 +#: components/points/includes/class-wordpoints-points-hooks.php:673 msgctxt "points type" msgid "Save" msgstr "Salvar" -#: components/points/includes/class-wordpoints-points-hooks.php:749 +#: components/points/includes/class-wordpoints-points-hooks.php:751 msgctxt "hook" msgid "Edit" msgstr "Editar" -#: components/points/includes/class-wordpoints-points-hooks.php:750 +#: components/points/includes/class-wordpoints-points-hooks.php:752 msgctxt "hook" msgid "Add" msgstr "Adicionar" -#: components/points/includes/class-wordpoints-points-hooks.php:777 +#: components/points/includes/class-wordpoints-points-hooks.php:779 #: components/ranks/admin/screens/ranks.php:124 msgid "Save" msgstr "Salvar" @@ -1067,12 +1067,12 @@ msgid "" "transactions performed by WordPoints are included in the logs." msgstr "" -#: components/points/includes/hooks/abstracts/post-type.php:240 +#: components/points/includes/hooks/abstracts/post-type.php:239 msgctxt "post title" msgid "(no title)" msgstr "(sem titulo)" -#: components/points/includes/hooks/abstracts/post-type.php:296 +#: components/points/includes/hooks/abstracts/post-type.php:295 msgid "Select post type:" msgstr "Selecione o tipo de post:" @@ -1208,81 +1208,81 @@ msgstr "Comentario movido para o lixo." msgid "Revoke the points if the comment is removed." msgstr "" -#: components/points/includes/hooks/periodic.php:42 +#: components/points/includes/hooks/periodic.php:43 msgctxt "points hook name" msgid "Periodic Points" msgstr "Pontos Periodicos" -#: components/points/includes/hooks/periodic.php:42 +#: components/points/includes/hooks/periodic.php:44 #, fuzzy msgid "Visiting the site at least once in a given time period." msgstr "" "Premei usuarios com pontos quando ele visitar o seu site ao menos uma vez em " "um periodo determinado." -#: components/points/includes/hooks/periodic.php:134 +#: components/points/includes/hooks/periodic.php:137 msgctxt "points log description" msgid "Hourly points." msgstr "Pontos por Hora." -#: components/points/includes/hooks/periodic.php:138 +#: components/points/includes/hooks/periodic.php:141 msgctxt "points log description" msgid "Daily points." msgstr "Pontos por Dia." -#: components/points/includes/hooks/periodic.php:142 +#: components/points/includes/hooks/periodic.php:145 msgctxt "points log description" msgid "Weekly points." msgstr "Pontos por Semana." -#: components/points/includes/hooks/periodic.php:146 +#: components/points/includes/hooks/periodic.php:149 msgctxt "points log description" msgid "Monthly points." msgstr "Pontos por Mês." -#: components/points/includes/hooks/periodic.php:150 +#: components/points/includes/hooks/periodic.php:153 msgctxt "points log description" msgid "Periodic points." msgstr "Pontos Periodicos." -#: components/points/includes/hooks/periodic.php:172 +#: components/points/includes/hooks/periodic.php:175 msgid "Visiting the site at least once in an hour." msgstr "" -#: components/points/includes/hooks/periodic.php:175 +#: components/points/includes/hooks/periodic.php:178 msgid "Visiting the site at least once in a day." msgstr "" -#: components/points/includes/hooks/periodic.php:178 +#: components/points/includes/hooks/periodic.php:181 msgid "Visiting the site at least once in a week." msgstr "" -#: components/points/includes/hooks/periodic.php:181 +#: components/points/includes/hooks/periodic.php:184 msgid "Visiting the site at least once in a month." msgstr "" -#: components/points/includes/hooks/periodic.php:184 +#: components/points/includes/hooks/periodic.php:187 msgid "Visiting the site periodically." msgstr "" -#: components/points/includes/hooks/periodic.php:238 +#: components/points/includes/hooks/periodic.php:241 msgctxt "length of time" msgid "Period:" msgstr "Periodo:" -#: components/points/includes/hooks/periodic.php:259 +#: components/points/includes/hooks/periodic.php:262 msgid "hourly" msgstr "Por Hora" -#: components/points/includes/hooks/periodic.php:260 +#: components/points/includes/hooks/periodic.php:263 msgid "daily" msgstr "Por dia" -#: components/points/includes/hooks/periodic.php:261 +#: components/points/includes/hooks/periodic.php:264 msgid "weekly" msgstr "Por Semana" -#: components/points/includes/hooks/periodic.php:262 +#: components/points/includes/hooks/periodic.php:265 msgid "monthly" msgstr "Por Mês" @@ -1354,7 +1354,9 @@ msgid "Post published." msgstr "Post publicado." #. translators: %s is the name of a post type. +#. translators: the post type's name. #: components/points/includes/hooks/post.php:66 +#: components/points/includes/logs.php:703 #, fuzzy msgctxt "points log description" msgid "%s deleted." @@ -1362,7 +1364,6 @@ msgstr "Tipos de Pontos deletados." #. translators: 1 is the post type name, 2 is the post title. #: components/points/includes/hooks/post.php:68 -#: components/points/includes/logs.php:703 #, fuzzy msgctxt "points log description" msgid "%1$s “%2$s” deleted." @@ -1370,13 +1371,13 @@ msgstr "%1$s \"%2$s\" deletado." #. translators: %s will be the post title. #: components/points/includes/hooks/post.php:70 -#: components/points/includes/logs.php:712 #, fuzzy msgctxt "points log description" msgid "Post “%s” deleted." msgstr "Post \"%s\" deletado." #: components/points/includes/hooks/post.php:71 +#: components/points/includes/logs.php:709 #, fuzzy msgctxt "points log description" msgid "Post deleted." @@ -1437,7 +1438,7 @@ msgstr "Procurar:" msgid "Search Logs" msgstr "Procurar:" -#: components/points/includes/logs.php:519 +#: components/points/includes/logs.php:509 #, fuzzy msgid "No matching logs found." msgstr "Nenhum registro correspondente foi encontrado" @@ -1462,24 +1463,24 @@ msgctxt "points log description" msgid "Comment unapproved." msgstr "Comentario não aprovado." -#: components/points/includes/points.php:963 +#: components/points/includes/points.php:954 msgctxt "points log" msgid "(no description)" msgstr "(sem descrição)" -#: components/points/includes/points.php:1122 +#: components/points/includes/points.php:1114 #, fuzzy msgctxt "top users table heading" msgid "Position" msgstr "Descrição" -#: components/points/includes/points.php:1123 +#: components/points/includes/points.php:1115 #, fuzzy msgctxt "top users table heading" msgid "User" msgstr "Usuário" -#: components/points/includes/points.php:1124 +#: components/points/includes/points.php:1116 #, fuzzy msgctxt "top users table heading" msgid "Points" @@ -1862,91 +1863,91 @@ msgid "" msgstr "" "O componente \"%s\" não pode ser desativado. Por favor tente novamente." -#: includes/class-wordpoints-components.php:546 +#: includes/class-wordpoints-components.php:564 msgid "" "WordPoints detected a large network and has skipped part of the installation " "process for the “%s” component." msgstr "" -#: includes/class-wordpoints-components.php:549 +#: includes/class-wordpoints-components.php:567 msgid "" "WordPoints detected a large network and has skipped part of the update " "process for the “%s” component for version %s (and possibly " "later versions)." msgstr "" -#: includes/class-wordpoints-components.php:555 +#: includes/class-wordpoints-components.php:573 msgid "" "The rest of the process needs to be completed manually. If this has not been " "done already, some parts of the component may not function properly." msgstr "" -#: includes/functions.php:525 +#: includes/functions.php:576 msgctxt "post type" msgid "Any" msgstr "Qualquer um" -#: includes/functions.php:623 +#: includes/functions.php:676 msgid "Shortcode error:" msgstr "Shortcode erro:" -#: includes/functions.php:762 +#: includes/functions.php:815 msgctxt "component name" msgid "Points" msgstr "Pontos" -#: includes/functions.php:764 includes/functions.php:789 +#: includes/functions.php:817 includes/functions.php:842 msgctxt "component author" msgid "WordPoints" msgstr "WordPoints" -#: includes/functions.php:767 +#: includes/functions.php:820 msgid "Enables a points system for your site." msgstr "Ativa o sistema de pontos no seu site." -#: includes/functions.php:787 +#: includes/functions.php:840 msgctxt "component name" msgid "Ranks" msgstr "" -#: includes/functions.php:792 +#: includes/functions.php:845 msgid "Assign users ranks based on their points levels." msgstr "" -#: includes/modules.php:473 +#: includes/modules.php:479 msgid "By %s." msgstr "Por %s." -#: includes/modules.php:632 +#: includes/modules.php:638 msgid "Invalid module path." msgstr "Paconte de módulo inválido." -#: includes/modules.php:636 +#: includes/modules.php:642 msgid "Module file does not exist." msgstr "Os arquivos do módulo não existem." -#: includes/modules.php:642 +#: includes/modules.php:648 msgid "The module does not have a valid header." msgstr "O módulo não tem um cabeçalho válido." -#: includes/modules.php:823 +#: includes/modules.php:829 msgid "The module generated unexpected output." msgstr "O módulo gerou uma saída inesperada." -#: includes/modules.php:1000 +#: includes/modules.php:1006 msgid "Could not access filesystem." msgstr "Não foi possível acessar os arquivos do sistema." -#: includes/modules.php:1004 +#: includes/modules.php:1010 msgid "Filesystem error." msgstr "Erro no Sistema de Arquivos." -#: includes/modules.php:1011 +#: includes/modules.php:1017 msgid "Unable to locate WordPoints Module directory." msgstr "Não foi possível localizar o diretório do módulo WordPoints" #. translators: A module or list of modules. -#: includes/modules.php:1057 +#: includes/modules.php:1063 #, fuzzy msgid "Could not fully remove the module %s." msgid_plural "Could not fully remove the modules %s." diff --git a/src/languages/wordpoints-zh_CN.mo b/src/languages/wordpoints-zh_CN.mo index 96507335..94a4bb33 100755 Binary files a/src/languages/wordpoints-zh_CN.mo and b/src/languages/wordpoints-zh_CN.mo differ diff --git a/src/languages/wordpoints-zh_CN.po b/src/languages/wordpoints-zh_CN.po index 9fb18f7c..1ccd6cef 100644 --- a/src/languages/wordpoints-zh_CN.po +++ b/src/languages/wordpoints-zh_CN.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: WordPoints 1.4.0\n" "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/wordpoints\n" -"POT-Creation-Date: 2015-01-30 22:50:22+00:00\n" +"POT-Creation-Date: 2015-02-27 21:33:55+00:00\n" "PO-Revision-Date: 2014-11-29 07:17+0200\n" "Last-Translator: Jack Lee \n" "Language-Team: Simplified Chinese 5 star rating." msgstr "" "如果您觉得WordPoints不错,请用5分评价以让更多人知道它。" -#: admin/admin.php:502 +#: admin/admin.php:514 msgid "" "If you don’t think this plugin deserves 5 stars, please let us know " "how we can improve it." msgstr "如果您觉得这个插件不值5分评价,请提出您的宝贵建议。" -#: admin/admin.php:505 +#: admin/admin.php:517 msgid "Need help?" msgstr "需要帮助?" -#: admin/admin.php:506 +#: admin/admin.php:518 msgid "" "Post your feature request or support question in the support " "forums" msgstr "请在支持论坛提交您的功能需求或者问题" -#: admin/admin.php:507 +#: admin/admin.php:519 msgid "Thank you for using WordPoints!" msgstr "感谢您使用WordPoints!" -#: admin/admin.php:540 +#: admin/admin.php:552 msgid "" "WordPoints detected a large network and has skipped part of the installation " "process." msgstr "WordPoints检测到多站,已跳过部分安装过程。" -#: admin/admin.php:543 +#: admin/admin.php:555 msgid "" "WordPoints detected a large network and has skipped part of the update " "process for version %s (and possibly later versions)." @@ -140,14 +140,14 @@ msgstr "" "WordPoints探测到一个大的多站网络,已经为版本%s (和更新的版本)跳过了部分更新过" "程。" -#: admin/admin.php:549 +#: admin/admin.php:561 msgid "" "The rest of the process needs to be completed manually. If this has not been " "done already, some parts of the plugin may not function properly." msgstr "" "剩余的过程需要完全人工操作.如果没有完成,该插件的某些功能可能无法正常工作。" -#: admin/admin.php:550 includes/class-wordpoints-components.php:556 +#: admin/admin.php:562 includes/class-wordpoints-components.php:574 msgid "Learn more." msgstr "了解更多。" @@ -240,7 +240,7 @@ msgstr[0] "未激活 (%s)" #: admin/includes/class-wordpoints-modules-list-table.php:427 #: admin/includes/class-wordpoints-modules-list-table.php:722 -#: admin/screens/configure-components.php:115 +#: admin/screens/configure-components.php:108 msgid "Activate" msgstr "激活" @@ -251,7 +251,7 @@ msgstr "网络停用" #: admin/includes/class-wordpoints-modules-list-table.php:431 #: admin/includes/class-wordpoints-modules-list-table.php:718 -#: admin/screens/configure-components.php:110 +#: admin/screens/configure-components.php:103 msgid "Deactivate" msgstr "停用" @@ -259,7 +259,7 @@ msgstr "停用" #: admin/includes/class-wordpoints-modules-list-table.php:710 #: admin/includes/class-wordpoints-modules-list-table.php:725 #: components/points/admin/admin.php:54 -#: components/points/includes/class-wordpoints-points-hooks.php:773 +#: components/points/includes/class-wordpoints-points-hooks.php:775 #: components/ranks/admin/admin.php:53 #: components/ranks/admin/screens/ranks.php:128 msgid "Delete" @@ -279,7 +279,7 @@ msgstr "版本 %s" #. translators: %s is the component author's name. #: admin/includes/class-wordpoints-modules-list-table.php:591 -#: admin/screens/configure-components.php:136 +#: admin/screens/configure-components.php:129 msgid "By %s" msgstr "作者 %s" @@ -310,25 +310,25 @@ msgid "Installed WordPoints components." msgstr "查看已安装的WordPoints组件。" #: admin/screens/configure-components.php:88 -#: admin/screens/configure-components.php:96 +#: admin/screens/configure-components.php:156 msgctxt "components table heading" msgid "Component" msgstr "组件" #: admin/screens/configure-components.php:89 -#: admin/screens/configure-components.php:97 +#: admin/screens/configure-components.php:157 msgctxt "components table heading" msgid "Description" msgstr "描述" #: admin/screens/configure-components.php:90 -#: admin/screens/configure-components.php:98 +#: admin/screens/configure-components.php:158 msgctxt "components table heading" msgid "Version" msgstr "版本" #: admin/screens/configure-components.php:91 -#: admin/screens/configure-components.php:99 +#: admin/screens/configure-components.php:159 msgctxt "components table heading" msgid "Action" msgstr "操作" @@ -929,67 +929,67 @@ msgstr "积分:" msgid "There are no points hooks currently available." msgstr "当前无可用的积分Hooks。" -#: components/points/includes/class-wordpoints-points-hooks.php:582 +#: components/points/includes/class-wordpoints-points-hooks.php:584 msgid "Settings" msgstr "设置" -#: components/points/includes/class-wordpoints-points-hooks.php:594 +#: components/points/includes/class-wordpoints-points-hooks.php:596 msgid "Slug" msgstr "别名" -#: components/points/includes/class-wordpoints-points-hooks.php:613 +#: components/points/includes/class-wordpoints-points-hooks.php:615 msgctxt "points type" msgid "Prefix (optional):" msgstr "前缀(可选):" -#: components/points/includes/class-wordpoints-points-hooks.php:614 +#: components/points/includes/class-wordpoints-points-hooks.php:616 msgctxt "points type" msgid "Suffix (optional):" msgstr "后缀(可选):" -#: components/points/includes/class-wordpoints-points-hooks.php:618 +#: components/points/includes/class-wordpoints-points-hooks.php:620 msgctxt "points type" msgid "Prefix:" msgstr "前缀:" -#: components/points/includes/class-wordpoints-points-hooks.php:619 +#: components/points/includes/class-wordpoints-points-hooks.php:621 msgctxt "points type" msgid "Suffix:" msgstr "后缀:" -#: components/points/includes/class-wordpoints-points-hooks.php:625 +#: components/points/includes/class-wordpoints-points-hooks.php:627 msgctxt "points type" msgid "Name:" msgstr "名称:" -#: components/points/includes/class-wordpoints-points-hooks.php:664 +#: components/points/includes/class-wordpoints-points-hooks.php:666 msgctxt "points type" msgid "Delete" msgstr "删除" -#: components/points/includes/class-wordpoints-points-hooks.php:668 -#: components/points/includes/class-wordpoints-points-hooks.php:774 +#: components/points/includes/class-wordpoints-points-hooks.php:670 +#: components/points/includes/class-wordpoints-points-hooks.php:776 #: components/ranks/admin/screens/ranks.php:100 #: components/ranks/admin/screens/ranks.php:126 msgid "Close" msgstr "关闭" -#: components/points/includes/class-wordpoints-points-hooks.php:671 +#: components/points/includes/class-wordpoints-points-hooks.php:673 msgctxt "points type" msgid "Save" msgstr "保存" -#: components/points/includes/class-wordpoints-points-hooks.php:749 +#: components/points/includes/class-wordpoints-points-hooks.php:751 msgctxt "hook" msgid "Edit" msgstr "编辑" -#: components/points/includes/class-wordpoints-points-hooks.php:750 +#: components/points/includes/class-wordpoints-points-hooks.php:752 msgctxt "hook" msgid "Add" msgstr "添加" -#: components/points/includes/class-wordpoints-points-hooks.php:777 +#: components/points/includes/class-wordpoints-points-hooks.php:779 #: components/ranks/admin/screens/ranks.php:124 msgid "Save" msgstr "保存" @@ -1007,12 +1007,12 @@ msgstr "" "此积分类型使用了自定义的元数据ID(“%s”)。如果这个ID已经被其它插件" "使用,请修改它,以避免出错。" -#: components/points/includes/hooks/abstracts/post-type.php:240 +#: components/points/includes/hooks/abstracts/post-type.php:239 msgctxt "post title" msgid "(no title)" msgstr "(无标题)" -#: components/points/includes/hooks/abstracts/post-type.php:296 +#: components/points/includes/hooks/abstracts/post-type.php:295 msgid "Select post type:" msgstr "请选择文章类型:" @@ -1140,78 +1140,78 @@ msgstr "%s上已收到的评论被移除。" msgid "Revoke the points if the comment is removed." msgstr "" -#: components/points/includes/hooks/periodic.php:42 +#: components/points/includes/hooks/periodic.php:43 msgctxt "points hook name" msgid "Periodic Points" msgstr "周期性积分" -#: components/points/includes/hooks/periodic.php:42 +#: components/points/includes/hooks/periodic.php:44 msgid "Visiting the site at least once in a given time period." msgstr "周期性访问网站,奖励积分。" -#: components/points/includes/hooks/periodic.php:134 +#: components/points/includes/hooks/periodic.php:137 msgctxt "points log description" msgid "Hourly points." msgstr "小时积分。" -#: components/points/includes/hooks/periodic.php:138 +#: components/points/includes/hooks/periodic.php:141 msgctxt "points log description" msgid "Daily points." msgstr "每天积分。" -#: components/points/includes/hooks/periodic.php:142 +#: components/points/includes/hooks/periodic.php:145 msgctxt "points log description" msgid "Weekly points." msgstr "每周积分。" -#: components/points/includes/hooks/periodic.php:146 +#: components/points/includes/hooks/periodic.php:149 msgctxt "points log description" msgid "Monthly points." msgstr "每月积分。" -#: components/points/includes/hooks/periodic.php:150 +#: components/points/includes/hooks/periodic.php:153 msgctxt "points log description" msgid "Periodic points." msgstr "周期性积分。" -#: components/points/includes/hooks/periodic.php:172 +#: components/points/includes/hooks/periodic.php:175 msgid "Visiting the site at least once in an hour." msgstr "每小时在线奖励积分。" -#: components/points/includes/hooks/periodic.php:175 +#: components/points/includes/hooks/periodic.php:178 msgid "Visiting the site at least once in a day." msgstr "至少在每天查看下这个网站。" -#: components/points/includes/hooks/periodic.php:178 +#: components/points/includes/hooks/periodic.php:181 msgid "Visiting the site at least once in a week." msgstr "至少在每周查看下这个网站。" -#: components/points/includes/hooks/periodic.php:181 +#: components/points/includes/hooks/periodic.php:184 msgid "Visiting the site at least once in a month." msgstr "至少在每个月查看下这个网站。" -#: components/points/includes/hooks/periodic.php:184 +#: components/points/includes/hooks/periodic.php:187 msgid "Visiting the site periodically." msgstr "查看这个网站的间隔期。" -#: components/points/includes/hooks/periodic.php:238 +#: components/points/includes/hooks/periodic.php:241 msgctxt "length of time" msgid "Period:" msgstr "周期:" -#: components/points/includes/hooks/periodic.php:259 +#: components/points/includes/hooks/periodic.php:262 msgid "hourly" msgstr "按小时" -#: components/points/includes/hooks/periodic.php:260 +#: components/points/includes/hooks/periodic.php:263 msgid "daily" msgstr "按天" -#: components/points/includes/hooks/periodic.php:261 +#: components/points/includes/hooks/periodic.php:264 msgid "weekly" msgstr "按周" -#: components/points/includes/hooks/periodic.php:262 +#: components/points/includes/hooks/periodic.php:265 msgid "monthly" msgstr "按月" @@ -1276,7 +1276,9 @@ msgid "Post published." msgstr "文章已发布。" #. translators: %s is the name of a post type. +#. translators: the post type's name. #: components/points/includes/hooks/post.php:66 +#: components/points/includes/logs.php:703 #, fuzzy msgctxt "points log description" msgid "%s deleted." @@ -1284,19 +1286,18 @@ msgstr "%s已被永久删除。" #. translators: 1 is the post type name, 2 is the post title. #: components/points/includes/hooks/post.php:68 -#: components/points/includes/logs.php:703 msgctxt "points log description" msgid "%1$s “%2$s” deleted." msgstr "%1$s “%2$s” 已删除." #. translators: %s will be the post title. #: components/points/includes/hooks/post.php:70 -#: components/points/includes/logs.php:712 msgctxt "points log description" msgid "Post “%s” deleted." msgstr "文章 “%s” 已删除." #: components/points/includes/hooks/post.php:71 +#: components/points/includes/logs.php:709 #, fuzzy msgctxt "points log description" msgid "Post deleted." @@ -1354,7 +1355,7 @@ msgstr "搜索记录:" msgid "Search Logs" msgstr "搜索记录" -#: components/points/includes/logs.php:519 +#: components/points/includes/logs.php:509 msgid "No matching logs found." msgstr "未找到匹配的记录。" @@ -1378,22 +1379,22 @@ msgctxt "points log description" msgid "Comment unapproved." msgstr "评论未通过审核。" -#: components/points/includes/points.php:963 +#: components/points/includes/points.php:954 msgctxt "points log" msgid "(no description)" msgstr "(无描述)" -#: components/points/includes/points.php:1122 +#: components/points/includes/points.php:1114 msgctxt "top users table heading" msgid "Position" msgstr "位置" -#: components/points/includes/points.php:1123 +#: components/points/includes/points.php:1115 msgctxt "top users table heading" msgid "User" msgstr "用户" -#: components/points/includes/points.php:1124 +#: components/points/includes/points.php:1116 msgctxt "top users table heading" msgid "Points" msgstr "积分" @@ -1761,7 +1762,7 @@ msgid "" "%2$s" msgstr "组件 “%s” 未能禁用,请重试。" -#: includes/class-wordpoints-components.php:546 +#: includes/class-wordpoints-components.php:564 msgid "" "WordPoints detected a large network and has skipped part of the installation " "process for the “%s” component." @@ -1769,7 +1770,7 @@ msgstr "" "WordPoints检测到一个大的多站网络并且已经为组件“%s”跳过了部分安装" "进程。" -#: includes/class-wordpoints-components.php:549 +#: includes/class-wordpoints-components.php:567 msgid "" "WordPoints detected a large network and has skipped part of the update " "process for the “%s” component for version %s (and possibly " @@ -1778,78 +1779,78 @@ msgstr "" "WordPoints检测到一个大的多站网络并且已经跳过了版本%s (和更新的版本)的更新进" "程。" -#: includes/class-wordpoints-components.php:555 +#: includes/class-wordpoints-components.php:573 msgid "" "The rest of the process needs to be completed manually. If this has not been " "done already, some parts of the component may not function properly." msgstr "剩余的进程需要人工完成,如果未被完成,此组件的部分功能将不可用。" -#: includes/functions.php:525 +#: includes/functions.php:576 msgctxt "post type" msgid "Any" msgstr "任何" -#: includes/functions.php:623 +#: includes/functions.php:676 msgid "Shortcode error:" msgstr "短代码错误:" -#: includes/functions.php:762 +#: includes/functions.php:815 msgctxt "component name" msgid "Points" msgstr "积分" -#: includes/functions.php:764 includes/functions.php:789 +#: includes/functions.php:817 includes/functions.php:842 msgctxt "component author" msgid "WordPoints" msgstr "WordPoints" -#: includes/functions.php:767 +#: includes/functions.php:820 msgid "Enables a points system for your site." msgstr "在您的网站启用一个积分系统。" -#: includes/functions.php:787 +#: includes/functions.php:840 msgctxt "component name" msgid "Ranks" msgstr "评级" -#: includes/functions.php:792 +#: includes/functions.php:845 msgid "Assign users ranks based on their points levels." msgstr "基于用户积分数量确定TA所在的等级。" -#: includes/modules.php:473 +#: includes/modules.php:479 msgid "By %s." msgstr "作者 %s.。" -#: includes/modules.php:632 +#: includes/modules.php:638 msgid "Invalid module path." msgstr "不可用的模块路径。" -#: includes/modules.php:636 +#: includes/modules.php:642 msgid "Module file does not exist." msgstr "模块文件不存在。" -#: includes/modules.php:642 +#: includes/modules.php:648 msgid "The module does not have a valid header." msgstr "此模块头部不可用。" -#: includes/modules.php:823 +#: includes/modules.php:829 msgid "The module generated unexpected output." msgstr "此模块产生了意外的输出。" -#: includes/modules.php:1000 +#: includes/modules.php:1006 msgid "Could not access filesystem." msgstr "文件系统权限错误。" -#: includes/modules.php:1004 +#: includes/modules.php:1010 msgid "Filesystem error." msgstr "文件系统错误。" -#: includes/modules.php:1011 +#: includes/modules.php:1017 msgid "Unable to locate WordPoints Module directory." msgstr "无法找到WordPoints模块目录。" #. translators: A module or list of modules. -#: includes/modules.php:1057 +#: includes/modules.php:1063 msgid "Could not fully remove the module %s." msgid_plural "Could not fully remove the modules %s." msgstr[0] "无法完全移除模块 %s." diff --git a/src/languages/wordpoints.pot b/src/languages/wordpoints.pot index e4329cfa..b6e42d68 100644 --- a/src/languages/wordpoints.pot +++ b/src/languages/wordpoints.pot @@ -2,9 +2,9 @@ # This file is distributed under the same license as the WordPoints package. msgid "" msgstr "" -"Project-Id-Version: WordPoints 1.9.0\n" +"Project-Id-Version: WordPoints 1.10.0\n" "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/wordpoints\n" -"POT-Creation-Date: 2015-01-30 22:50:22+00:00\n" +"POT-Creation-Date: 2015-02-27 21:33:55+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -12,7 +12,7 @@ msgstr "" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -#. #-#-#-#-# wordpoints.pot (WordPoints 1.9.0) #-#-#-#-# +#. #-#-#-#-# wordpoints.pot (WordPoints 1.10.0) #-#-#-#-# #. Plugin Name of the plugin/theme #: admin/admin.php:67 components/points/admin/admin.php:280 #: components/points/includes/widgets.php:120 @@ -43,101 +43,101 @@ msgstr "" msgid "Install Modules" msgstr "" -#: admin/admin.php:281 +#: admin/admin.php:293 msgid "Hide This Notice" msgstr "" -#: admin/admin.php:334 +#: admin/admin.php:346 msgid "WordPoints — %s" msgstr "" -#: admin/admin.php:364 +#: admin/admin.php:376 msgid "Install a module in .zip format" msgstr "" -#: admin/admin.php:365 +#: admin/admin.php:377 msgid "" "If you have a module in a .zip format, you may install it by uploading it " "here." msgstr "" -#: admin/admin.php:368 +#: admin/admin.php:380 msgid "Module zip file" msgstr "" -#: admin/admin.php:370 +#: admin/admin.php:382 msgid "Install Now" msgstr "" -#: admin/admin.php:387 +#: admin/admin.php:399 msgid "" "You do not have sufficient permissions to install WordPoints modules on this " "site." msgstr "" -#: admin/admin.php:394 +#: admin/admin.php:406 msgid "Upload WordPoints Module" msgstr "" -#: admin/admin.php:406 +#: admin/admin.php:418 msgid "Installing Module from uploaded file: %s" msgstr "" -#: admin/admin.php:470 +#: admin/admin.php:482 msgid "" "This appears to be a WordPoints module archive. Try installing it on the " "WordPoints module install screen instead." msgstr "" -#: admin/admin.php:500 +#: admin/admin.php:512 msgid "Like this plugin?" msgstr "" -#: admin/admin.php:501 +#: admin/admin.php:513 msgid "" "If you think WordPoints is great, let everyone know by giving it a 5 star rating." msgstr "" -#: admin/admin.php:502 +#: admin/admin.php:514 msgid "" "If you don’t think this plugin deserves 5 stars, please let us know " "how we can improve it." msgstr "" -#: admin/admin.php:505 +#: admin/admin.php:517 msgid "Need help?" msgstr "" -#: admin/admin.php:506 +#: admin/admin.php:518 msgid "" "Post your feature request or support question in the support " "forums" msgstr "" -#: admin/admin.php:507 +#: admin/admin.php:519 msgid "Thank you for using WordPoints!" msgstr "" -#: admin/admin.php:540 +#: admin/admin.php:552 msgid "" "WordPoints detected a large network and has skipped part of the installation " "process." msgstr "" -#: admin/admin.php:543 +#: admin/admin.php:555 msgid "" "WordPoints detected a large network and has skipped part of the update " "process for version %s (and possibly later versions)." msgstr "" -#: admin/admin.php:549 +#: admin/admin.php:561 msgid "" "The rest of the process needs to be completed manually. If this has not been " "done already, some parts of the plugin may not function properly." msgstr "" -#: admin/admin.php:550 includes/class-wordpoints-components.php:556 +#: admin/admin.php:562 includes/class-wordpoints-components.php:574 msgid "Learn more." msgstr "" @@ -234,7 +234,7 @@ msgstr[1] "" #: admin/includes/class-wordpoints-modules-list-table.php:427 #: admin/includes/class-wordpoints-modules-list-table.php:722 -#: admin/screens/configure-components.php:115 +#: admin/screens/configure-components.php:108 msgid "Activate" msgstr "" @@ -245,7 +245,7 @@ msgstr "" #: admin/includes/class-wordpoints-modules-list-table.php:431 #: admin/includes/class-wordpoints-modules-list-table.php:718 -#: admin/screens/configure-components.php:110 +#: admin/screens/configure-components.php:103 msgid "Deactivate" msgstr "" @@ -253,7 +253,7 @@ msgstr "" #: admin/includes/class-wordpoints-modules-list-table.php:710 #: admin/includes/class-wordpoints-modules-list-table.php:725 #: components/points/admin/admin.php:54 -#: components/points/includes/class-wordpoints-points-hooks.php:773 +#: components/points/includes/class-wordpoints-points-hooks.php:775 #: components/ranks/admin/admin.php:53 #: components/ranks/admin/screens/ranks.php:128 msgid "Delete" @@ -273,7 +273,7 @@ msgstr "" #. translators: %s is the component author's name. #: admin/includes/class-wordpoints-modules-list-table.php:591 -#: admin/screens/configure-components.php:136 +#: admin/screens/configure-components.php:129 msgid "By %s" msgstr "" @@ -304,25 +304,25 @@ msgid "Installed WordPoints components." msgstr "" #: admin/screens/configure-components.php:88 -#: admin/screens/configure-components.php:96 +#: admin/screens/configure-components.php:156 msgctxt "components table heading" msgid "Component" msgstr "" #: admin/screens/configure-components.php:89 -#: admin/screens/configure-components.php:97 +#: admin/screens/configure-components.php:157 msgctxt "components table heading" msgid "Description" msgstr "" #: admin/screens/configure-components.php:90 -#: admin/screens/configure-components.php:98 +#: admin/screens/configure-components.php:158 msgctxt "components table heading" msgid "Version" msgstr "" #: admin/screens/configure-components.php:91 -#: admin/screens/configure-components.php:99 +#: admin/screens/configure-components.php:159 msgctxt "components table heading" msgid "Action" msgstr "" @@ -889,67 +889,67 @@ msgstr "" msgid "There are no points hooks currently available." msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:582 +#: components/points/includes/class-wordpoints-points-hooks.php:584 msgid "Settings" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:594 +#: components/points/includes/class-wordpoints-points-hooks.php:596 msgid "Slug" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:613 +#: components/points/includes/class-wordpoints-points-hooks.php:615 msgctxt "points type" msgid "Prefix (optional):" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:614 +#: components/points/includes/class-wordpoints-points-hooks.php:616 msgctxt "points type" msgid "Suffix (optional):" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:618 +#: components/points/includes/class-wordpoints-points-hooks.php:620 msgctxt "points type" msgid "Prefix:" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:619 +#: components/points/includes/class-wordpoints-points-hooks.php:621 msgctxt "points type" msgid "Suffix:" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:625 +#: components/points/includes/class-wordpoints-points-hooks.php:627 msgctxt "points type" msgid "Name:" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:664 +#: components/points/includes/class-wordpoints-points-hooks.php:666 msgctxt "points type" msgid "Delete" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:668 -#: components/points/includes/class-wordpoints-points-hooks.php:774 +#: components/points/includes/class-wordpoints-points-hooks.php:670 +#: components/points/includes/class-wordpoints-points-hooks.php:776 #: components/ranks/admin/screens/ranks.php:100 #: components/ranks/admin/screens/ranks.php:126 msgid "Close" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:671 +#: components/points/includes/class-wordpoints-points-hooks.php:673 msgctxt "points type" msgid "Save" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:749 +#: components/points/includes/class-wordpoints-points-hooks.php:751 msgctxt "hook" msgid "Edit" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:750 +#: components/points/includes/class-wordpoints-points-hooks.php:752 msgctxt "hook" msgid "Add" msgstr "" -#: components/points/includes/class-wordpoints-points-hooks.php:777 +#: components/points/includes/class-wordpoints-points-hooks.php:779 #: components/ranks/admin/screens/ranks.php:124 msgid "Save" msgstr "" @@ -965,12 +965,12 @@ msgid "" "transactions performed by WordPoints are included in the logs." msgstr "" -#: components/points/includes/hooks/abstracts/post-type.php:240 +#: components/points/includes/hooks/abstracts/post-type.php:239 msgctxt "post title" msgid "(no title)" msgstr "" -#: components/points/includes/hooks/abstracts/post-type.php:296 +#: components/points/includes/hooks/abstracts/post-type.php:295 msgid "Select post type:" msgstr "" @@ -1092,78 +1092,78 @@ msgstr "" msgid "Revoke the points if the comment is removed." msgstr "" -#: components/points/includes/hooks/periodic.php:42 +#: components/points/includes/hooks/periodic.php:43 msgctxt "points hook name" msgid "Periodic Points" msgstr "" -#: components/points/includes/hooks/periodic.php:42 +#: components/points/includes/hooks/periodic.php:44 msgid "Visiting the site at least once in a given time period." msgstr "" -#: components/points/includes/hooks/periodic.php:134 +#: components/points/includes/hooks/periodic.php:137 msgctxt "points log description" msgid "Hourly points." msgstr "" -#: components/points/includes/hooks/periodic.php:138 +#: components/points/includes/hooks/periodic.php:141 msgctxt "points log description" msgid "Daily points." msgstr "" -#: components/points/includes/hooks/periodic.php:142 +#: components/points/includes/hooks/periodic.php:145 msgctxt "points log description" msgid "Weekly points." msgstr "" -#: components/points/includes/hooks/periodic.php:146 +#: components/points/includes/hooks/periodic.php:149 msgctxt "points log description" msgid "Monthly points." msgstr "" -#: components/points/includes/hooks/periodic.php:150 +#: components/points/includes/hooks/periodic.php:153 msgctxt "points log description" msgid "Periodic points." msgstr "" -#: components/points/includes/hooks/periodic.php:172 +#: components/points/includes/hooks/periodic.php:175 msgid "Visiting the site at least once in an hour." msgstr "" -#: components/points/includes/hooks/periodic.php:175 +#: components/points/includes/hooks/periodic.php:178 msgid "Visiting the site at least once in a day." msgstr "" -#: components/points/includes/hooks/periodic.php:178 +#: components/points/includes/hooks/periodic.php:181 msgid "Visiting the site at least once in a week." msgstr "" -#: components/points/includes/hooks/periodic.php:181 +#: components/points/includes/hooks/periodic.php:184 msgid "Visiting the site at least once in a month." msgstr "" -#: components/points/includes/hooks/periodic.php:184 +#: components/points/includes/hooks/periodic.php:187 msgid "Visiting the site periodically." msgstr "" -#: components/points/includes/hooks/periodic.php:238 +#: components/points/includes/hooks/periodic.php:241 msgctxt "length of time" msgid "Period:" msgstr "" -#: components/points/includes/hooks/periodic.php:259 +#: components/points/includes/hooks/periodic.php:262 msgid "hourly" msgstr "" -#: components/points/includes/hooks/periodic.php:260 +#: components/points/includes/hooks/periodic.php:263 msgid "daily" msgstr "" -#: components/points/includes/hooks/periodic.php:261 +#: components/points/includes/hooks/periodic.php:264 msgid "weekly" msgstr "" -#: components/points/includes/hooks/periodic.php:262 +#: components/points/includes/hooks/periodic.php:265 msgid "monthly" msgstr "" @@ -1227,26 +1227,27 @@ msgid "Post published." msgstr "" #. translators: %s is the name of a post type. +#. translators: the post type's name. #: components/points/includes/hooks/post.php:66 +#: components/points/includes/logs.php:703 msgctxt "points log description" msgid "%s deleted." msgstr "" #. translators: 1 is the post type name, 2 is the post title. #: components/points/includes/hooks/post.php:68 -#: components/points/includes/logs.php:703 msgctxt "points log description" msgid "%1$s “%2$s” deleted." msgstr "" #. translators: %s will be the post title. #: components/points/includes/hooks/post.php:70 -#: components/points/includes/logs.php:712 msgctxt "points log description" msgid "Post “%s” deleted." msgstr "" #: components/points/includes/hooks/post.php:71 +#: components/points/includes/logs.php:709 msgctxt "points log description" msgid "Post deleted." msgstr "" @@ -1302,7 +1303,7 @@ msgstr "" msgid "Search Logs" msgstr "" -#: components/points/includes/logs.php:519 +#: components/points/includes/logs.php:509 msgid "No matching logs found." msgstr "" @@ -1326,22 +1327,22 @@ msgctxt "points log description" msgid "Comment unapproved." msgstr "" -#: components/points/includes/points.php:963 +#: components/points/includes/points.php:954 msgctxt "points log" msgid "(no description)" msgstr "" -#: components/points/includes/points.php:1122 +#: components/points/includes/points.php:1114 msgctxt "top users table heading" msgid "Position" msgstr "" -#: components/points/includes/points.php:1123 +#: components/points/includes/points.php:1115 msgctxt "top users table heading" msgid "User" msgstr "" -#: components/points/includes/points.php:1124 +#: components/points/includes/points.php:1116 msgctxt "top users table heading" msgid "Points" msgstr "" @@ -1686,91 +1687,91 @@ msgid "" "%2$s" msgstr "" -#: includes/class-wordpoints-components.php:546 +#: includes/class-wordpoints-components.php:564 msgid "" "WordPoints detected a large network and has skipped part of the installation " "process for the “%s” component." msgstr "" -#: includes/class-wordpoints-components.php:549 +#: includes/class-wordpoints-components.php:567 msgid "" "WordPoints detected a large network and has skipped part of the update " "process for the “%s” component for version %s (and possibly " "later versions)." msgstr "" -#: includes/class-wordpoints-components.php:555 +#: includes/class-wordpoints-components.php:573 msgid "" "The rest of the process needs to be completed manually. If this has not been " "done already, some parts of the component may not function properly." msgstr "" -#: includes/functions.php:525 +#: includes/functions.php:576 msgctxt "post type" msgid "Any" msgstr "" -#: includes/functions.php:623 +#: includes/functions.php:676 msgid "Shortcode error:" msgstr "" -#: includes/functions.php:762 +#: includes/functions.php:815 msgctxt "component name" msgid "Points" msgstr "" -#: includes/functions.php:764 includes/functions.php:789 +#: includes/functions.php:817 includes/functions.php:842 msgctxt "component author" msgid "WordPoints" msgstr "" -#: includes/functions.php:767 +#: includes/functions.php:820 msgid "Enables a points system for your site." msgstr "" -#: includes/functions.php:787 +#: includes/functions.php:840 msgctxt "component name" msgid "Ranks" msgstr "" -#: includes/functions.php:792 +#: includes/functions.php:845 msgid "Assign users ranks based on their points levels." msgstr "" -#: includes/modules.php:473 +#: includes/modules.php:479 msgid "By %s." msgstr "" -#: includes/modules.php:632 +#: includes/modules.php:638 msgid "Invalid module path." msgstr "" -#: includes/modules.php:636 +#: includes/modules.php:642 msgid "Module file does not exist." msgstr "" -#: includes/modules.php:642 +#: includes/modules.php:648 msgid "The module does not have a valid header." msgstr "" -#: includes/modules.php:823 +#: includes/modules.php:829 msgid "The module generated unexpected output." msgstr "" -#: includes/modules.php:1000 +#: includes/modules.php:1006 msgid "Could not access filesystem." msgstr "" -#: includes/modules.php:1004 +#: includes/modules.php:1010 msgid "Filesystem error." msgstr "" -#: includes/modules.php:1011 +#: includes/modules.php:1017 msgid "Unable to locate WordPoints Module directory." msgstr "" #. translators: A module or list of modules. -#: includes/modules.php:1057 +#: includes/modules.php:1063 msgid "Could not fully remove the module %s." msgid_plural "Could not fully remove the modules %s." msgstr[0] "" diff --git a/src/readme.txt b/src/readme.txt index 3a8e2592..c8f16b8d 100644 --- a/src/readme.txt +++ b/src/readme.txt @@ -2,9 +2,9 @@ Contributors: jdgrimes Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=TPXS6B98HURLJ&lc=US&item_name=WordPoints&item_number=wordpressorg¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted Tags: points, awards, rewards, cubepoints, credits, gamify, multisite, ranks -Requires at least: 3.8 -Tested up to: 4.2-alpha-31007 -Stable tag: 1.9.0 +Requires at least: 3.9 +Tested up to: 4.2-alpha-31546 +Stable tag: 1.10.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -44,6 +44,9 @@ The plugin also provides [several widgets](http://wordpoints.org/user-guide/widg More features are always being planned, and you can check out the roadmap on the plugin website, [WordPoints.org](http://wordpoints.org/roadmap/). +Also on the plugin's website, you can [browse the available extensions](http://wordpoints.org/modules/), +called "modules". We've just added [a module that imports from CubePoints to WordPoints](http://wordpoints.org/modules/importer/). + = Localization = WordPoints is fully localizable, and translations are already available in several @@ -120,6 +123,20 @@ manage the ranks used on your site. == Changelog == += 1.10.0 — (~20 hrs) = +* Requires: WordPress 3.9+ +* Fixed: Current points values not being displayed beside inputs on profile screen. +* Fixed: The modules cache being preserved too long when using persistent caching. +* Fixed: Other caching issues on multisite. +* Updated: Numerous other small fixes and minor improvements. + += 1.9.2 — (~2 hrs) = +* Fixed: A bug preventing updating a user's points from their admin profile when +they don't have any points yet. + += 1.9.1 — (~3 hrs) = +* Fixed: A bug preventing ranks from being saved or updated. + = 1.9.0 - (~65 hrs) = * Updated: The title for the "Points" column in the points logs and top users tables will be replaced with the name of the points type being displayed. @@ -246,6 +263,17 @@ choosing the points type to add it to. == Upgrade Notice == += 1.10.0 = +* This is a minor release which contains a few small improvements and several fixed +bugs. + += 1.9.2 = +* Fixes a bug preventing a user's points from being updated on their admin profile +if they have 0 points. + += 1.9.1 = +* Fixes a bug preventing ranks from being saved or updated. + = 1.9.0 = * This release deprecates the Comment Removed and Post Delete points hooks. Their functionality is now combined with the Comment and Post hooks, which now automatically diff --git a/src/wordpoints.php b/src/wordpoints.php index 0e1a9cd0..19f14574 100644 --- a/src/wordpoints.php +++ b/src/wordpoints.php @@ -4,7 +4,7 @@ * Plugin Name: WordPoints * Plugin URI: http://wordpoints.org/ * Description: Create one or more points systems for your site, and reward user activity. - * Version: 1.9.0 + * Version: 1.10.0 * Author: J.D. Grimes * Author URI: http://codesymphony.co/ * License: GPLv2 @@ -40,7 +40,7 @@ * * @package WordPoints * @author J.D. Grimes - * @version 1.9.0 + * @version 1.10.0 * @license http://opensource.org/licenses/gpl-license.php GPL, version 2 or later. * @copyright 2013-2015 J.D. Grimes */ diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index a4493837..434d21a1 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -57,7 +57,10 @@ if ( defined( 'RUNNING_WORDPOINTS_MODULE_TESTS' ) - && ! running_wordpoints_module_uninstall_tests() + && ( + ! function_exists( 'running_wordpoints_module_uninstall_tests' ) + || ! running_wordpoints_module_uninstall_tests() + ) ) { tests_add_filter( 'muplugins_loaded', 'wordpointstests_manually_load_plugin' ); diff --git a/tests/phpunit/includes/factories/points-log.php b/tests/phpunit/includes/factories/points-log.php index 3cdb49d3..7c4e76a4 100644 --- a/tests/phpunit/includes/factories/points-log.php +++ b/tests/phpunit/includes/factories/points-log.php @@ -88,7 +88,7 @@ public function create_object( $args ) { $args['log_meta'] = array(); } - if ( empty( $args['log_meta'] ) ) { + if ( ! empty( $args['log_meta'] ) ) { $this->listen_for_insert_id = false; add_action( 'query', array( $this, 'get_log_id' ) ); } @@ -102,15 +102,17 @@ public function create_object( $args ) { ); if ( empty( $args['log_meta'] ) ) { + $log_id = $wpdb->insert_id; + } else { + $log_id = $this->insert_id; remove_action( 'query', array( $this, 'get_log_id' ) ); - $this->log_id = $wpdb->insert_id; } if ( isset( $args['text'] ) ) { - $this->update_object( $this->log_id, array( 'text' => $args['text'] ) ); + $this->update_object( $log_id, array( 'text' => $args['text'] ) ); } - return $this->log_id; + return $log_id; } /** diff --git a/tests/phpunit/includes/mocks/rank-type.php b/tests/phpunit/includes/mocks/rank-type.php index 942dcfff..fe9852ad 100644 --- a/tests/phpunit/includes/mocks/rank-type.php +++ b/tests/phpunit/includes/mocks/rank-type.php @@ -14,6 +14,14 @@ */ class WordPoints_Test_Rank_Type extends WordPoints_Rank_Type { + /** + * @since 1.9.1 + */ + protected $name = 'Test'; + + /** + * @since 1.7.0 + */ protected $meta_fields = array( 'test_meta' => array() ); // @@ -21,7 +29,19 @@ class WordPoints_Test_Rank_Type extends WordPoints_Rank_Type { // /** - * Destroy the rank type hanlder when this rank type is deregistered. + * @since 1.9.1 + */ + public function __construct( array $args ) { + + parent::__construct( $args ); + + if ( isset( $args['meta_fields'] ) ) { + $this->meta_fields = $args['meta_fields']; + } + } + + /** + * Destroy the rank type handler when this rank type is deregistered. * * @since 1.7.0 */ @@ -34,7 +54,7 @@ public function destruct() {} * * @param array $meta The metadata to validate. * - * @return array|false The validated metadata or false if it should't be saved. + * @return array|false The validated metadata or false if it shouldn't be saved. */ public function validate_rank_meta( array $meta ) { diff --git a/tests/phpunit/tests/components.php b/tests/phpunit/tests/components.php index f5198502..b0ffd7fe 100644 --- a/tests/phpunit/tests/components.php +++ b/tests/phpunit/tests/components.php @@ -44,6 +44,8 @@ public function tearDown() { * Test that the instance() method returns and instance of the class. * * @since 1.0.1 + * + * @covers WordPoints_Components::instance */ public function test_instance_returns_instance() { @@ -55,6 +57,9 @@ public function test_instance_returns_instance() { * * @since 1.0.1 * + * @covers WordPoints_Components::register + * @covers WordPoints_Components::is_registered + * * @expectedIncorrectUsage WordPoints_Components::register */ public function test_registration() { @@ -81,6 +86,8 @@ public function test_registration() { * Test that register() returns false if already registered. * * @since 1.0.1 + * + * @covers WordPoints_Components::register */ public function test_register_fails_if_already_registered() { @@ -96,6 +103,9 @@ public function test_register_fails_if_already_registered() { * * @since 1.0.1 * + * @covers WordPoints_Components::activate + * @covers WordPoints_Components::is_active + * * @expectedIncorrectUsage WordPoints_Components::register */ public function test_activation() { @@ -120,11 +130,57 @@ public function test_activation() { * Test that an unregistered component can't be activated. * * @since 1.0.1 + * + * @covers WordPoints_Components::activate */ public function test_activation_fails_if_not_registered() { $this->assertFalse( WordPoints_Components::instance()->activate( 'not_registered' ) ); } + + /** + * Test that all components are returned by get(). + * + * @since 1.10.0 + * + * @covers WordPoints_Components::get + */ + public function test_get() { + + $components = WordPoints_Components::instance()->get(); + + $this->assertInternalType( 'array', $components ); + $this->assertArrayHasKey( 'points', $components ); + $this->assertInternalType( 'array', $components['points'] ); + } + + /** + * Test getting the data for a component. + * + * @since 1.10.0 + * + * @covers WordPoints_Components::get_component + */ + public function test_get_component() { + + $component = WordPoints_Components::instance()->get_component( 'points' ); + + $this->assertInternalType( 'array', $component ); + } + + /** + * Test getting the data for an unregistered component. + * + * @since 1.10.0 + * + * @covers WordPoints_Components::get_component + */ + public function test_get_unregistered_component() { + + $this->assertFalse( + WordPoints_Components::instance()->get_component( 'unregistered' ) + ); + } } // EOF diff --git a/tests/phpunit/tests/modules/module-headers.php b/tests/phpunit/tests/modules/module-headers.php index 97042fc3..73f0c1f0 100644 --- a/tests/phpunit/tests/modules/module-headers.php +++ b/tests/phpunit/tests/modules/module-headers.php @@ -11,6 +11,8 @@ * Test that module headers are properly parsed. * * @since 1.1.0 + * + * @group modules */ class WordPoints_Module_Header_Test extends WP_UnitTestCase { @@ -34,6 +36,7 @@ class WordPoints_Module_Header_Test extends WP_UnitTestCase { 'title' => 'Test 3', 'author_name' => 'WordPoints Tester', 'update_api' => '', + 'channel' => '', 'ID' => '', ); diff --git a/tests/phpunit/tests/modules/modules.php b/tests/phpunit/tests/modules/modules.php index 9431c789..87a40ae0 100644 --- a/tests/phpunit/tests/modules/modules.php +++ b/tests/phpunit/tests/modules/modules.php @@ -49,6 +49,7 @@ public function test_get_modules() { 'title' => 'Test 3', 'author_name' => 'WordPoints Tester', 'update_api' => '', + 'channel' => '', 'ID' => '', ), 'test-4/test-4.php' => array( @@ -64,6 +65,7 @@ public function test_get_modules() { 'title' => 'Test 4', 'author_name' => 'WordPoints Tester', 'update_api' => '', + 'channel' => '', 'ID' => '', ), ) @@ -85,6 +87,7 @@ public function test_get_modules() { 'title' => 'Test 4', 'author_name' => 'WordPoints Tester', 'update_api' => '', + 'channel' => '', 'ID' => '', ), ) diff --git a/tests/phpunit/tests/points/admin/profile.php b/tests/phpunit/tests/points/admin/profile.php new file mode 100644 index 00000000..50d53212 --- /dev/null +++ b/tests/phpunit/tests/points/admin/profile.php @@ -0,0 +1,263 @@ +user = $this->factory->user->create_and_get(); + $this->user->add_cap( 'set_wordpoints_points' ); + + wp_set_current_user( $this->user->ID ); + + $_POST['wordpoints_points_set_nonce'] = wp_create_nonce( + 'wordpoints_points_set_profile' + ); + + $_POST['wordpoints_points_set-points'] = '1'; + $_POST['wordpoints_points-points'] = '5'; + $_POST['wordpoints_points_old-points'] = '0'; + $_POST['wordpoints_set_reason'] = 'Testing.'; + } + + /** + * Test that the the user's points are updated successfully. + * + * @since 1.9.2 + */ + public function test_points_updated() { + + $this->assert_update_succeeds(); + } + + /** + * Test that current user must have set_wordpoints_points capability. + * + * @since 1.9.2 + */ + public function test_current_user_must_have_required_caps() { + + $this->user = $this->factory->user->create_and_get(); + wp_set_current_user( $this->user->ID ); + + $this->assert_update_fails(); + } + + /** + * Test that an nonce is required. + * + * @since 1.9.2 + */ + public function test_nonce_required() { + + unset( $_POST['wordpoints_points_set_nonce'] ); + + $this->assert_update_fails(); + } + + /** + * Test that a valid nonce is required. + * + * @since 1.9.2 + */ + public function test_valid_nonce_required() { + + $_POST['wordpoints_points_set_nonce'] = 'invlaid'; + + $this->assert_update_fails(); + } + + /** + * Test that the checkbox must be checked. + * + * @since 1.9.2 + */ + public function test_checkbox_must_be_checked() { + + unset( $_POST['wordpoints_points_set-points'] ); + + $this->assert_update_fails(); + } + + /** + * Test that the points value is required. + * + * @since 1.9.2 + */ + public function test_points_value_required() { + + unset( $_POST['wordpoints_points-points'] ); + + $this->assert_update_fails(); + } + + /** + * Test that the points value must be an integer. + * + * @since 1.9.2 + */ + public function test_points_must_be_integer() { + + $_POST['wordpoints_points-points'] = 'foo'; + + $this->assert_update_fails(); + } + + /** + * Test that the points value can be an integer. + * + * @since 1.9.2 + */ + public function test_points_can_be_0() { + + $_POST['wordpoints_points-points'] = '0'; + $_POST['wordpoints_points_old-points'] = '5'; + + wordpoints_set_points( $this->user->ID, 5, 'points', 'test' ); + + wordpoints_points_profile_options_update( $this->user->ID ); + + $this->assertEquals( 0, wordpoints_get_points( $this->user->ID, 'points' ) ); + } + + + /** + * Test that the old points value is required. + * + * @since 1.9.2 + */ + public function test_old_points_value_required() { + + unset( $_POST['wordpoints_points_old-points'] ); + + $this->assert_update_fails(); + } + + /** + * Test that the old points value must be an integer. + * + * @since 1.9.2 + */ + public function test_old_points_must_be_integer() { + + $_POST['wordpoints_points-points'] = 'foo'; + + $this->assert_update_fails(); + } + + /** + * Test that the old points value can be an integer. + * + * @since 1.9.2 + */ + public function test_old_points_can_be_0() { + + $_POST['wordpoints_points_old-points'] = '0'; + $_POST['wordpoints_points-points'] = '5'; + + wordpoints_set_points( $this->user->ID, 0, 'points', 'test' ); + + wordpoints_points_profile_options_update( $this->user->ID ); + + $this->assertEquals( 5, wordpoints_get_points( $this->user->ID, 'points' ) ); + } + + /** + * Test that the reason is required. + * + * @since 1.9.2 + */ + public function test_reason_required() { + + unset( $_POST['wordpoints_set_reason'] ); + + $this->assert_update_fails(); + } + + /** + * Test that the reason is used in the log. + * + * @since 1.9.2 + */ + public function test_reason_used_in_log() { + + wordpoints_points_profile_options_update( $this->user->ID ); + + $query = new WordPoints_Points_Logs_Query(); + + $this->assertStringMatchesFormat( + 'Points adjusted by %s. Reason: Testing.' + , $query->get( 'row' )->text + ); + } + + // + // Helpers. + // + + /** + * Assert that the update will fail. + * + * @since 1.9.2 + */ + protected function assert_update_fails() { + + wordpoints_points_profile_options_update( $this->user->ID ); + + $this->assertEquals( 0, wordpoints_get_points( $this->user->ID, 'points' ) ); + } + + /** + * Assert that the update will succeed. + * + * @since 1.9.2 + */ + protected function assert_update_succeeds() { + + wordpoints_points_profile_options_update( $this->user->ID ); + + $this->assertEquals( 5, wordpoints_get_points( $this->user->ID, 'points' ) ); + } +} + +// EOF diff --git a/tests/phpunit/tests/points/ajax/hooks.php b/tests/phpunit/tests/points/ajax/hooks.php index 78db656f..15099b5c 100644 --- a/tests/phpunit/tests/points/ajax/hooks.php +++ b/tests/phpunit/tests/points/ajax/hooks.php @@ -170,12 +170,10 @@ public function test_delete_hook() { try { $this->_handleAjax( 'save-wordpoints-points-hook' ); - } catch ( WPAjaxDieContinueException $e ) { - unset( $e ); + } catch ( WPAjaxDieStopException $e ) { + $this->assertEquals( 'deleted:' . $hook->get_id(), $e->getMessage() ); } - $this->assertEquals( 'deleted:' . $hook->get_id(), $this->_last_response ); - $hooks = WordPoints_Points_Hooks::get_points_type_hooks( 'points' ); $this->assertCount( 0, $hooks ); diff --git a/tests/phpunit/tests/points/hooks/post.php b/tests/phpunit/tests/points/hooks/post.php index 955c6449..031b395c 100644 --- a/tests/phpunit/tests/points/hooks/post.php +++ b/tests/phpunit/tests/points/hooks/post.php @@ -584,10 +584,10 @@ public function test_delete_post_log_text() { , 10 , 'points' , 'post_delete' - , array( 'post_title' => 'Test title' ) + , array() ); - $this->assertEquals( 'Post “Test title” deleted.', $text ); + $this->assertEquals( 'Post deleted.', $text ); } /** @@ -604,10 +604,10 @@ public function test_delete_post_log_text_with_post_type() { , 10 , 'points' , 'post_delete' - , array( 'post_title' => 'Test title', 'post_type' => 'page' ) + , array( 'post_type' => 'page' ) ); - $this->assertEquals( 'Page “Test title” deleted.', $text ); + $this->assertEquals( 'Page deleted.', $text ); } /** @@ -624,10 +624,10 @@ public function test_delete_post_log_text_with_bad_post_type() { , 10 , 'points' , 'post_delete' - , array( 'post_title' => 'Test title', 'post_type' => 'not' ) + , array( 'post_type' => 'not' ) ); - $this->assertEquals( 'Post “Test title” deleted.', $text ); + $this->assertEquals( 'Post deleted.', $text ); } // diff --git a/tests/phpunit/tests/points/update/1-10-0.php b/tests/phpunit/tests/points/update/1-10-0.php new file mode 100644 index 00000000..029bbb32 --- /dev/null +++ b/tests/phpunit/tests/points/update/1-10-0.php @@ -0,0 +1,106 @@ +markTestSkipped( 'Multisite must be disabled.' ); + } + + $this->factory->wordpoints_points_log->create( + array( + 'log_type' => 'post_delete', + 'log_meta' => array( 'post_title' => 'Test Post' ), + ) + ); + + $query = new WordPoints_Points_Logs_Query( + array( + 'log_type' => 'post_delete', + 'meta_query' => array( + array( 'key' => 'post_title', 'compare' => 'EXISTS' ), + ), + ) + ); + + $this->assertCount( 1, $query->get() ); + + $this->update_component(); + + $this->assertCount( 0, $query->get() ); + } + + /** + * Test that unused 'post_title' log meta deleted on update. + * + * @since 1.10.0 + */ + public function test_post_title_points_log_meta_deleted_network() { + + if ( ! is_wordpoints_network_active() ) { + $this->markTestSkipped( 'WordPoints must be network-active.' ); + } + + $this->factory->wordpoints_points_log->create( + array( + 'log_type' => 'post_delete', + 'log_meta' => array( 'post_title' => 'Test Post' ), + ) + ); + + $blog_id = $this->factory->blog->create(); + + switch_to_blog( $blog_id ); + $this->factory->wordpoints_points_log->create( + array( + 'log_type' => 'post_delete', + 'log_meta' => array( 'post_title' => 'Test Post' ), + ) + ); + restore_current_blog(); + + $query = new WordPoints_Points_Logs_Query( + array( + 'log_type' => 'post_delete', + 'blog_id' => false, + 'meta_query' => array( + array( 'key' => 'post_title', 'compare' => 'EXISTS' ), + ), + ) + ); + + $this->assertCount( 2, $query->get() ); + + $this->update_component(); + + $this->assertCount( 0, $query->get() ); + } +} + +// EOF diff --git a/tests/phpunit/tests/points/update/1-5-1.php b/tests/phpunit/tests/points/update/1-5-1.php index 9111c6a7..b589e76c 100644 --- a/tests/phpunit/tests/points/update/1-5-1.php +++ b/tests/phpunit/tests/points/update/1-5-1.php @@ -18,9 +18,12 @@ class WordPoints_Points_1_5_1_Update_Test extends WordPoints_Points_UnitTestCase { /** - * Test that database table charachter sets are updated. + * Test that database table character sets are updated. * * @since 1.5.1 + * + * @covers WordPoints_Points_Un_Installer::update_network_to_1_5_1 + * @covers WordPoints_Points_Un_Installer::update_single_to_1_5_1 */ public function test_db_table_charsets_updated() { @@ -68,13 +71,13 @@ public function test_db_table_charsets_updated() { // Simulate the update. $this->update_component( 'points', '1.5.0' ); - $this->assertStringEndsWith( - 'DEFAULT CHARSET=utf8' + $this->assertStringMatchesFormat( + '%aDEFAULT CHARSET=utf8%A' , $wpdb->get_var( "SHOW CREATE TABLE `{$wpdb->wordpoints_points_logs}`", 1 ) ); - $this->assertStringEndsWith( - 'DEFAULT CHARSET=utf8' + $this->assertStringMatchesFormat( + '%aDEFAULT CHARSET=utf8%A' , $wpdb->get_var( "SHOW CREATE TABLE `{$wpdb->wordpoints_points_log_meta}`", 1 ) ); diff --git a/tests/phpunit/tests/ranks/rank-type.php b/tests/phpunit/tests/ranks/rank-type.php new file mode 100644 index 00000000..c617a2ad --- /dev/null +++ b/tests/phpunit/tests/ranks/rank-type.php @@ -0,0 +1,329 @@ +mock_rank_type = new WordPoints_Test_Rank_Type( + array( 'slug' => 'test' ) + ); + } + + /** + * Test that get_slug() returns the rank type's slug. + * + * @since 1.9.1 + * + * @covers WordPoints_Rank_Type::get_slug + */ + public function test_get_slug() { + + $this->assertEquals( 'test', $this->mock_rank_type->get_slug() ); + } + + /** + * Test that get_name() returns the rank type's name. + * + * @since 1.9.1 + * + * @covers WordPoints_Rank_Type::get_name + */ + public function test_get_name() { + + $this->assertEquals( 'Test', $this->mock_rank_type->get_name() ); + } + + /** + * Test that get_meta_fields() returns the rank type's meta fields. + * + * @since 1.9.1 + * + * @covers WordPoints_Rank_Type::get_meta_fields + */ + public function test_get_meta_fields() { + + $this->assertEquals( + array( 'test_meta' => array() ) + , $this->mock_rank_type->get_meta_fields() + ); + } + + /** + * Test that display_rank_meta_form_fields() displays a text field's value. + * + * @since 1.9.1 + * + * @covers WordPoints_Rank_Type::display_rank_meta_form_fields + */ + public function test_display_rank_meta_form_fields_text_field() { + + $xpath = $this->get_rank_meta_form_xpath( + array( 'test_field' => array( 'type' => 'text', 'default' => 'ddd' ) ) + , array( 'test_field' => 'testing' ) + ); + + $inputs = $xpath->query( '//input[@type = "text"]' ); + + $this->assertEquals( 1, $inputs->length ); + + $this->assertEquals( + 'testing' + , $inputs->item( 0 )->attributes->getNamedItem( 'value' )->nodeValue + ); + } + + /** + * Test that display_rank_meta_form_fields() displays a field's default value. + * + * @since 1.9.1 + * + * @covers WordPoints_Rank_Type::display_rank_meta_form_fields + */ + public function test_display_rank_meta_form_fields_field_default() { + + $xpath = $this->get_rank_meta_form_xpath( + array( + 'test_field' => array( 'type' => 'text', 'default' => 'default' ) + ) + ); + + $inputs = $xpath->query( '//input[@type = "text"]' ); + + $this->assertEquals( 1, $inputs->length ); + + $this->assertEquals( + 'default' + , $inputs->item( 0 )->attributes->getNamedItem( 'value' )->nodeValue + ); + } + + /** + * Test that display_rank_meta_form_fields() supports the 'number' field type. + * + * @since 1.9.1 + * + * @covers WordPoints_Rank_Type::display_rank_meta_form_fields + */ + public function test_display_rank_meta_form_fields_number_field() { + + $xpath = $this->get_rank_meta_form_xpath( + array( 'test_field' => array( 'type' => 'number', 'default' => 0 ) ) + , array( 'test_field' => 25 ) + ); + + $inputs = $xpath->query( '//input[@type = "number"]' ); + + $this->assertEquals( 1, $inputs->length ); + + $this->assertEquals( + 25 + , $inputs->item( 0 )->attributes->getNamedItem( 'value' )->nodeValue + ); + } + + /** + * Test that display_rank_meta_form_fields() supports the 'hidden' field type. + * + * @since 1.9.1 + * + * @covers WordPoints_Rank_Type::display_rank_meta_form_fields + */ + public function test_display_rank_meta_form_fields_hidden_field() { + + $xpath = $this->get_rank_meta_form_xpath( + array( 'test_field' => array( 'type' => 'hidden', 'default' => 0 ) ) + , array( 'test_field' => 25 ) + ); + + $inputs = $xpath->query( '//input[@type = "hidden"]' ); + + $this->assertEquals( 1, $inputs->length ); + + $this->assertEquals( + 25 + , $inputs->item( 0 )->attributes->getNamedItem( 'value' )->nodeValue + ); + } + + /** + * Test that display_rank_meta_form_fields() gives an error for invalid field types. + * + * @since 1.9.1 + * + * @covers WordPoints_Rank_Type::display_rank_meta_form_fields + * + * @expectedIncorrectUsage WordPoints_Rank_Type::display_rank_meta_form_fields + */ + public function test_display_rank_meta_form_fields_invalid_field_type_error() { + + $rank_type = new WordPoints_Test_Rank_Type( + array( + 'slug' => 'test', + 'meta_fields' => array( + 'bad' => array( 'type' => 'invalid', 'default' => '' ) + ) + ) + ); + + ob_start(); + $rank_type->display_rank_meta_form_fields(); + $form = ob_get_clean(); + + $this->assertEmpty( $form ); + } + + /** + * Test that display_rank_meta_form_fields() displays a field's label. + * + * @since 1.9.1 + * + * @covers WordPoints_Rank_Type::display_rank_meta_form_fields + */ + public function test_display_rank_meta_form_fields_field_label() { + + $xpath = $this->get_rank_meta_form_xpath( + array( + 'test_field' => array( + 'type' => 'text', + 'default' => 'default', + 'label' => 'Field label', + ) + ) + ); + + $inputs = $xpath->query( '//label' ); + + $this->assertEquals( 1, $inputs->length ); + + $this->assertEquals( 'Field label', trim( $inputs->item( 0 )->textContent ) ); + } + + /** + * Test that display_rank_meta_form_fields() displays field placeholders. + * + * @since 1.9.1 + * + * @covers WordPoints_Rank_Type::display_rank_meta_form_fields + */ + public function test_display_rank_meta_form_fields_field_placeholders() { + + $rank_type = new WordPoints_Test_Rank_Type( + array( + 'slug' => 'test', + 'meta_fields' => array( + 'test_field' => array( 'type' => 'text', 'default' => '' ) + ) + ) + ); + + ob_start(); + $rank_type->display_rank_meta_form_fields( + array() + , array( 'placeholders' => true ) + ); + $form = ob_get_clean(); + + $this->assertStringMatchesFormat( + '%avalue="<% if ( typeof test_field !== "undefined" ) { print( test_field ); } %>"%a' + , $form + ); + } + + /** + * Test that display_rank_meta_form_fields() doesn't use placeholders for hidden fields. + * + * @since 1.9.1 + * + * @covers WordPoints_Rank_Type::display_rank_meta_form_fields + */ + public function test_display_rank_meta_form_fields_hidden_field_placeholders() { + + $xpath = $this->get_rank_meta_form_xpath( + array( 'test_field' => array( 'type' => 'hidden', 'default' => 0 ) ) + , array() + , array( 'placeholders' => true ) + ); + + $inputs = $xpath->query( '//input[@type = "hidden"]' ); + + $this->assertEquals( 1, $inputs->length ); + + $this->assertEquals( + '0' + , $inputs->item( 0 )->attributes->getNamedItem( 'value' )->nodeValue + ); + } + + // + // Helpers. + // + + /** + * Get and XPath object for the form for the meta fields. + * + * @since 1.9.1 + * + * @param array $meta_fields The meta fields definition. + * @param array $meta The predefined meta values. + * @param array $args The form display args. + * + * @return DOMXPath XPath object loaded with the form HTML. + */ + protected function get_rank_meta_form_xpath( + array $meta_fields = array(), + array $meta = array(), + array $args = array() + ) { + + $rank_type = $this->mock_rank_type; + + if ( ! empty( $meta_fields ) ) { + $rank_type = new WordPoints_Test_Rank_Type( + array( 'slug' => 'test', 'meta_fields' => $meta_fields ) + ); + } + + ob_start(); + $rank_type->display_rank_meta_form_fields( $meta, $args ); + $form = ob_get_clean(); + + $document = new DOMDocument; + $document->loadHTML( $form ); + $xpath = new DOMXPath( $document ); + + return $xpath; + } +} + +// EOF diff --git a/tests/phpunit/tests/sanitization.php b/tests/phpunit/tests/sanitization.php new file mode 100644 index 00000000..5d856872 --- /dev/null +++ b/tests/phpunit/tests/sanitization.php @@ -0,0 +1,84 @@ + '' ) ); + $error = wordpoints_sanitize_wp_error( $error ); + $this->assertEquals( array( 'title' => 'alert("!");' ), $error->get_error_data() ); + } + + /** + * Test that it doesn't explode when there is no title. + * + * @since 1.10.0 + * + * @covers ::wordpoints_sanitize_wp_error + */ + public function test_wordpoints_sanitize_wp_error_no_title() { + + $data = array( 'blah' => 'foo' ); + + $error = new WP_Error( 'test', 'Testing', $data ); + $error = wordpoints_sanitize_wp_error( $error ); + + $this->assertEquals( $data, $error->get_error_data() ); + } + + /** + * Test that it sanitizes the message. + * + * @since 1.10.0 + * + * @covers ::wordpoints_sanitize_wp_error + */ + public function test_wordpoints_sanitize_wp_error_sanitizes_message() { + + $error = new WP_Error( 'test', '' ); + $error = wordpoints_sanitize_wp_error( $error ); + $this->assertEquals( 'alert("!");', $error->get_error_message() ); + } + + /** + * Test that it sanitizes multiple messages if present. + * + * @since 1.10.0 + * + * @covers ::wordpoints_sanitize_wp_error + */ + public function test_wordpoints_sanitize_wp_error_sanitizes_messages() { + + $error = new WP_Error( 'test', '' ); + $error->add( 'test', 'click' ); + $error->add( 'foo', '' ); + + $error = wordpoints_sanitize_wp_error( $error ); + + $this->assertEquals( + array( 'alert("!");', 'click', '' ) + , $error->get_error_messages() + ); + } +} + +// EOF diff --git a/tools/bin/update-pot.sh b/tools/bin/update-pot.sh deleted file mode 100755 index f6a28da7..00000000 --- a/tools/bin/update-pot.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -if [ -z $1 ]; then - echo 'Usage: update-pot.sh ' - exit 0 -fi - -src=$( cd "$1"; pwd ) -bin=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) - -php "$bin/../i18n/makepot.php" wordpoints "$src" - -for f in $(find "$src/languages" -name '*.po' -type f); do - msgmerge --backup=off --update "$f" "$src/languages/wordpoints.pot" - msgfmt -o "${f%po}mo" "$f" -done - -# EOF diff --git a/tools/bin/update-version.sh b/tools/bin/update-version.sh deleted file mode 100755 index 5830a925..00000000 --- a/tools/bin/update-version.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -if [ -z $1 ]; - then echo "Usage: $0 "; - exit; -fi - -sed -i '' -e 's/\(\* @\{0,1\}[Vv]\{1\}ersion:\{0,1\}\) \([^\n]*\)/\1 '"$1"'/' \ - ./src/wordpoints.php; - -sed -i '' -e 's/VERSION'"'"', '"'"'[^'"'"']*/VERSION'"'"', '"'""$1"'/' \ - ./src/includes/constants.php diff --git a/tools/i18n/makepot.php b/tools/i18n/makepot.php deleted file mode 100644 index 352dbc2b..00000000 --- a/tools/i18n/makepot.php +++ /dev/null @@ -1,229 +0,0 @@ -meta['wordpoints'] = $this->meta['wp-plugin']; - - $this->meta['wordpoints-module'] = array( - 'description' => 'Translation of the WordPoints module {name} {version} by {author}', - 'msgid-bugs-address' => '', - 'copyright-holder' => '{author}', - 'package-name' => 'WordPoints {name}', - 'package-version' => '{version}', - 'comments' => "Copyright (C) {year} {copyright-holder}\nThis file is distributed under the same license as the {package-name} package.", - ); - } - - /** - * Generate the POT file for WordPoints. - * - * @since 1.9.0 - * - * @param string $dir The directory containing WordPoints's source. - * @param string $output The path of the output file. - * - * @return bool Whether the POT file was generated successfully. - */ - public function wordpoints( $dir, $output = null ) { - - if ( is_null( $output ) ){ - $output = "{$dir}/languages/wordpoints.pot"; - } - - return $this->wp_plugin( $dir, $output, 'wordpoints' ); - } - - /** - * Generate the POT file for a WordPoints module. - * - * @since 1.9.0 - * - * @param string $dir The directory containing WordPoints's source. - * @param string $output The path of the output file. - * @param string $slug The slug of the module. - * - * @return bool Whether the POT file was generated successfully. - */ - public function wordpoints_module( $dir, $output = null, $slug = null ) { - - if ( is_null( $slug ) ) { - $slug = $this->guess_plugin_slug( $dir ); - } - - if ( is_null( $output ) ){ - $output = "{$dir}/languages/{$slug}.pot"; - } - - // Escape pattern-matching characters in the path. - $module_escape_root = str_replace( - array( '*', '?', '[' ) - , array( '[*]', '[?]', '[[]' ) - , $dir - ); - - // Get the top level files. - $module_files = glob( "{$module_escape_root}/*.php" ); - - if ( empty( $module_files ) ) { - $this->error( 'No module source files found.' ); - return false; - } - - $main_file = ''; - - foreach ( $module_files as $module_file ) { - - if ( ! is_readable( $module_file ) ) { - continue; - } - - $source = $this->get_first_lines( $module_file, $this->max_header_lines ); - - // Stop when we find a file with a module name header in it. - if ( false !== $this->get_addon_header( 'Module Name', $source ) ) { - $main_file = $module_file; - break; - } - } - - if ( empty( $main_file ) ) { - $this->error( 'Couldn\'t locate the main module file.' ); - return false; - } - - $placeholders = array(); - $placeholders['version'] = $this->get_addon_header( 'Version', $source ); - $placeholders['author'] = $this->get_addon_header( 'Author', $source ); - $placeholders['name'] = $this->get_addon_header( 'Module Name', $source ); - $placeholders['slug'] = $slug; - - // Attempt to extract the strings and write them to the POT file. - $result = $this->xgettext( 'wordpoints-module', $dir, $output, $placeholders ); - - if ( ! $result ) { - return false; - } - - // Now attempt to append the headers from the module file, so they can be - // translated too. - $potextmeta = new WordPoints_PotExtMeta; - if ( ! $potextmeta->append( $main_file, $output ) ) { - return false; - } - - // Adding non-gettexted strings can repeat some phrases, so uniquify them. - $output_shell = escapeshellarg( $output ); - system( "msguniq {$output_shell} -o {$output_shell}" ); - - return true; - } - - /** - * Give an error. - * - * @since 1.9.0 - * - * @param string $message The error message. - */ - public function error( $message ) { - fwrite( STDERR, $message . "\n" ); - } -} - -/** - * Add metadata strings from a WordPoints module header to a POT file. - * - * @since 1.9.0 - */ -class WordPoints_PotExtMeta extends PotExtMeta { - - /** - * @since 1.9.0 - */ - public function __construct() { - - $this->headers[] = 'Module Name'; - $this->headers[] = 'Module URI'; - } - - /** - * @since 1.9.0 - */ - public function load_from_file( $ext_filename ) { - - return str_replace( - ' of the plugin/theme' - , ' of the module' - , parent::load_from_file( $ext_filename ) - ); - } -} - -// Run the CLI only if the file wasn't included. -$included_files = get_included_files(); - -if ( __FILE__ === $included_files[0] ) { - - $makepot = new WordPoints_MakePOT; - - if ( count( $argv ) >= 3 && in_array( $argv[1], $makepot->projects ) ) { - - $result = call_user_func( - array( $makepot, str_replace( '-', '_', $argv[1] ) ) - , realpath( $argv[2] ) - , isset( $argv[3] ) ? $argv[3] : null - , isset( $argv[4] ) ? $argv[4] : null - ); - - if ( false === $result ) { - $makepot->error( 'Couldn\'t generate POT file!' ); - } - - } else { - - $usage = "Usage: php makepot.php [ []] \n\n"; - $usage .= "Generate POT file from the files in \n"; - $usage .= 'Available projects: ' . implode( ', ', $makepot->projects ) . "\n"; - fwrite( STDERR, $usage ); - exit( 1 ); - } -} - -// EOF diff --git a/tools/wp-l10n-validator/cache.json b/tools/wp-l10n-validator/cache.json index 5ffe1b5b..ab7bf722 100644 --- a/tools/wp-l10n-validator/cache.json +++ b/tools/wp-l10n-validator/cache.json @@ -1,7 +1,7 @@ { "\/admin\/admin.php": { - "size": 16642, - "hash": "4c6c673e7d62daefa05bd228b5c329cf", + "size": 16992, + "hash": "592e49b3457bca6dd9870c3a2d23ce68", "errors": false }, "\/admin\/includes\/class-wordpoints-module-installer-skin.php": { @@ -15,8 +15,13 @@ "errors": false }, "\/admin\/includes\/class-wordpoints-modules-list-table.php": { - "size": 21942, - "hash": "a471c7d554773bf2468312043a4e312b", + "size": 21944, + "hash": "8895103b08ef01a6da3f830ac3fd7971", + "errors": false + }, + "\/admin\/includes\/deprecated.php": { + "size": 339, + "hash": "8eb0461e028c2bcad1e9281aa4d9df53", "errors": false }, "\/admin\/screens\/configure-components-load.php": { @@ -25,8 +30,13 @@ "errors": false }, "\/admin\/screens\/configure-components.php": { - "size": 5274, - "hash": "8b23b741c4770c5a9323b869dc1c8724", + "size": 5264, + "hash": "5a76e9a84b80036a791be3078918790a", + "errors": false + }, + "\/admin\/screens\/configure-settings-load.php": { + "size": 1100, + "hash": "cc791be8c2d13d6daad4c8d8406ea79e", "errors": false }, "\/admin\/screens\/configure-settings.php": { @@ -45,23 +55,33 @@ "errors": false }, "\/admin\/screens\/modules-load.php": { - "size": 16667, - "hash": "b07c9245c3c178a1f68197d405d5c398", + "size": 16981, + "hash": "c3a558cdbdc2fd79d090acf8dbf59674", "errors": false }, "\/admin\/screens\/modules.php": { - "size": 4719, - "hash": "4218b9dfdb6348095fcce1787c90a2de", + "size": 4724, + "hash": "7c4679182a848fe41c63d89570cd29d7", "errors": false }, - "\/components\/index.php": { - "size": 27, - "hash": "a3f720aa8693dbbf2c538fde4dc7b2b1", + "\/components\/points\/admin\/admin.php": { + "size": 13692, + "hash": "31102cdcdf8ae9673f122a466825806a", "errors": false }, - "\/components\/points\/admin\/admin.php": { - "size": 13667, - "hash": "a375d0d7ec7ab33fcba902d4d56b114f", + "\/components\/points\/admin\/includes\/ajax.php": { + "size": 7490, + "hash": "65c9fd47d508ad07993ae16129851885", + "errors": false + }, + "\/components\/points\/admin\/screens\/hooks-load.php": { + "size": 3308, + "hash": "ffb14b46b096a39ab611777f30d85879", + "errors": false + }, + "\/components\/points\/admin\/screens\/hooks-no-js-load.php": { + "size": 3302, + "hash": "ca1ebf1d9bdbab057d36ae91bfe3f980", "errors": false }, "\/components\/points\/admin\/screens\/hooks-no-js.php": { @@ -79,134 +99,29 @@ "hash": "11a06a64286b667f82708cccea4e72cd", "errors": false }, + "\/components\/points\/includes\/class-un-installer.php": { + "size": 22349, + "hash": "cdd240190dae32ec7a82f5de20bec947", + "errors": false + }, "\/components\/points\/includes\/class-wordpoints-points-hook.php": { "size": 21968, "hash": "f73011b5d623c7a10e979dcc86f9f672", "errors": false }, "\/components\/points\/includes\/class-wordpoints-points-hooks.php": { - "size": 24489, - "hash": "efd605b2fc001a6b7d153591544ab80e", + "size": 24528, + "hash": "cae6fd995aaa29ef52cbf5a8b9c12694", "errors": false }, "\/components\/points\/includes\/class-wordpoints-points-logs-query.php": { "size": 31412, - "hash": "db6bee3b812b8b6c2473efc34d64f783", - "errors": false - }, - "\/components\/points\/includes\/functions.php": { - "size": 8299, - "hash": "302e437518df025e29d317285cf6354d", - "errors": false - }, - "\/components\/points\/includes\/hooks.php": { - "size": 1042, - "hash": "59d283d8b74b37a375bb87ffda70642e", - "errors": false - }, - "\/components\/points\/includes\/index.php": { - "size": 28, - "hash": "f2dd0b74d953dcd2f078efd9dbe74330", - "errors": false - }, - "\/components\/points\/includes\/logs.php": { - "size": 21321, - "hash": "34895e5b190f88a7e78d72c87ec61639", - "errors": false - }, - "\/components\/points\/includes\/shortcodes.php": { - "size": 8393, - "hash": "b8b0a2349f9e4ef86c7dcf3da65a3a74", - "errors": false - }, - "\/components\/points\/includes\/widgets.php": { - "size": 16582, - "hash": "79e3dd77e6df2f7690531c23b7648bbd", - "errors": false - }, - "\/components\/points\/index.php": { - "size": 22, - "hash": "fc4cdc7613c06325a1358fbb1820097c", - "errors": false - }, - "\/components\/points\/install.php": { - "size": 394, - "hash": "4af2a50bfe0d790977ea8cc7181b273a", - "errors": false - }, - "\/components\/points\/points.php": { - "size": 3015, - "hash": "938923abe55f0d9b42ad2c15b2765ce4", - "errors": false - }, - "\/components\/points\/uninstall.php": { - "size": 147, - "hash": "56552a47dceb1ea6529ba0163d73d67d", - "errors": false - }, - "\/includes\/class-wordpoints-components.php": { - "size": 14682, - "hash": "bebd58d482994b6361c30c44b0d4b417", - "errors": false - }, - "\/includes\/deprecated.php": { - "size": 11243, - "hash": "d596efc6bd6d554fdf369db66b59d870", - "errors": false - }, - "\/includes\/functions.php": { - "size": 22141, - "hash": "7a312d4261121eb536a96b5279c8b3b3", - "errors": false - }, - "\/includes\/index.php": { - "size": 26, - "hash": "e93b6d5dfa6f6f47bd719928d65d85c5", - "errors": false - }, - "\/includes\/modules.php": { - "size": 33664, - "hash": "a78a087a7194253be092b7b8aaca57a8", - "errors": false - }, - "\/includes\/scripts.php": { - "size": 1403, - "hash": "7ac6252eacd03211fc7dbb910e888f29", - "errors": false - }, - "\/index.php": { - "size": 33, - "hash": "9f94aa1d201d265aaade64c225a656b1", - "errors": false - }, - "\/install.php": { - "size": 243, - "hash": "763323680611d8d99eb982e62075beb4", - "errors": false - }, - "\/uninstall.php": { - "size": 498, - "hash": "35915582c6a9f8d93298324711d4327e", - "errors": false - }, - "\/wordpoints.php": { - "size": 5159, - "hash": "f30f4f63391d548f0394571274e09381", - "errors": false - }, - "\/components\/points\/admin\/includes\/ajax.php": { - "size": 6921, - "hash": "0f024f3ad1aa67b6481ef91b2186896a", - "errors": false - }, - "\/components\/points\/admin\/screens\/hooks-load.php": { - "size": 3308, - "hash": "ffb14b46b096a39ab611777f30d85879", + "hash": "c089e5a5d9cfcf24d04795a22a751e94", "errors": false }, - "\/components\/points\/admin\/screens\/hooks-no-js-load.php": { - "size": 3302, - "hash": "ca1ebf1d9bdbab057d36ae91bfe3f980", + "\/components\/points\/includes\/constants.php": { + "size": 308, + "hash": "89f0fd2a543a04443cb6d11442c69dda", "errors": false }, "\/components\/points\/includes\/deprecated.php": { @@ -214,24 +129,29 @@ "hash": "60cf40bff1741f84fa2535c72b797a3f", "errors": false }, - "\/includes\/constants.php": { - "size": 647, - "hash": "331c2362e63a618ee91c1b6971ba5010", + "\/components\/points\/includes\/functions.php": { + "size": 8525, + "hash": "cc2cd6c3a4293152fd8ce594421f4fc9", "errors": false }, - "\/components\/points\/includes\/update.php": { - "size": 11881, - "hash": "1753c05d31aaaad858db2819ad4dba9b", + "\/components\/points\/includes\/hooks\/abstracts\/comment-approved.php": { + "size": 9420, + "hash": "1a681d23c1387be3940507054739e59c", "errors": false }, - "\/includes\/update.php": { - "size": 769, - "hash": "507b3392245feee8425e0d8d6fae6c20", + "\/components\/points\/includes\/hooks\/abstracts\/post-type.php": { + "size": 10558, + "hash": "0c85c54291269424b3f8195b99df6067", + "errors": false + }, + "\/components\/points\/includes\/hooks\/comment-received.php": { + "size": 2335, + "hash": "810a243313f4eff732ee5d91bffc5909", "errors": false }, "\/components\/points\/includes\/hooks\/comment-removed.php": { - "size": 4967, - "hash": "c73ab375085815e859fbee0b61933952", + "size": 4966, + "hash": "5e0482b3f5b2f1b704b99a005b2a7c4d", "errors": false }, "\/components\/points\/includes\/hooks\/comment.php": { @@ -240,48 +160,63 @@ "errors": false }, "\/components\/points\/includes\/hooks\/periodic.php": { - "size": 6852, - "hash": "ca1aeee2b499d1374987f7bf729a3c99", + "size": 6860, + "hash": "a1b98f63b3813e90aeec4297e9574b81", "errors": false }, "\/components\/points\/includes\/hooks\/post-delete.php": { - "size": 3363, - "hash": "a9f5a6cf67ca4c88f255d45ecde3675b", + "size": 3362, + "hash": "d8eb4c9c8965e154722ed7248bb8e51f", "errors": false }, "\/components\/points\/includes\/hooks\/post.php": { - "size": 7575, - "hash": "ae00a3576cdcb2f8acb411c40a183c99", + "size": 7574, + "hash": "46de3a7811f7973b08a724c37211b56a", "errors": false }, "\/components\/points\/includes\/hooks\/registration.php": { - "size": 1892, - "hash": "59b66597353ee9a182a01b8593b42147", + "size": 1891, + "hash": "804f2f513ff3a0570d3dcbec8dccba73", "errors": false }, - "\/admin\/screens\/configure-settings-load.php": { - "size": 1100, - "hash": "cc791be8c2d13d6daad4c8d8406ea79e", + "\/components\/points\/includes\/hooks.php": { + "size": 1042, + "hash": "59d283d8b74b37a375bb87ffda70642e", "errors": false }, - "\/components\/points\/includes\/hooks\/abstracts\/post-type.php": { - "size": 10611, - "hash": "22beb19a27b421301dc2e94c854cd740", + "\/components\/points\/includes\/logs.php": { + "size": 21135, + "hash": "5d660e1ff5317c8d0e04e8201054926e", "errors": false }, - "\/admin\/includes\/deprecated.php": { - "size": 339, - "hash": "8eb0461e028c2bcad1e9281aa4d9df53", + "\/components\/points\/includes\/points.php": { + "size": 35597, + "hash": "7418f20be13c1232022e1ab1fff1eb64", "errors": false }, - "\/components\/points\/includes\/constants.php": { - "size": 308, - "hash": "89f0fd2a543a04443cb6d11442c69dda", + "\/components\/points\/includes\/shortcodes.php": { + "size": 8393, + "hash": "b8b0a2349f9e4ef86c7dcf3da65a3a74", "errors": false }, - "\/components\/points\/includes\/points.php": { - "size": 35652, - "hash": "044fdacb4dd7f8acb30cd861fec253f9", + "\/components\/points\/includes\/widgets.php": { + "size": 16598, + "hash": "f32f0508ba75b923ea3f7824c2507a42", + "errors": false + }, + "\/components\/points\/install.php": { + "size": 394, + "hash": "4af2a50bfe0d790977ea8cc7181b273a", + "errors": false + }, + "\/components\/points\/points.php": { + "size": 3015, + "hash": "938923abe55f0d9b42ad2c15b2765ce4", + "errors": false + }, + "\/components\/points\/uninstall.php": { + "size": 147, + "hash": "56552a47dceb1ea6529ba0163d73d67d", "errors": false }, "\/components\/ranks\/admin\/admin.php": { @@ -299,19 +234,24 @@ "hash": "25ab447d4809235c805a8ab37e4d9347", "errors": false }, + "\/components\/ranks\/includes\/class-un-installer.php": { + "size": 2482, + "hash": "4dbe09f394361165f9ac44e0ebf56b7c", + "errors": false + }, "\/components\/ranks\/includes\/class-wordpoints-rank-group.php": { "size": 10892, "hash": "cb05a4d06d7184ec97b09dbc76300f1b", "errors": false }, "\/components\/ranks\/includes\/class-wordpoints-rank-groups.php": { - "size": 4355, - "hash": "fe2cf46188e3b792aaf07bacef5e8272", + "size": 4305, + "hash": "71a66264f07a54735624248feb319140", "errors": false }, "\/components\/ranks\/includes\/class-wordpoints-rank-type.php": { - "size": 8631, - "hash": "3f1e8c218c3ea0cceeada3e93b8e7834", + "size": 9016, + "hash": "d36a10fdca8c83ddb26f6c4dcb611dda", "errors": false }, "\/components\/ranks\/includes\/class-wordpoints-rank-types.php": { @@ -329,6 +269,11 @@ "hash": "46189156c9713b8da0020140d0800231", "errors": false }, + "\/components\/ranks\/includes\/deprecated.php": { + "size": 666, + "hash": "16945f69526feb24e66f314b1f9173bf", + "errors": false + }, "\/components\/ranks\/includes\/functions.php": { "size": 1314, "hash": "42cdbcf83d635860bbc332196ed589dc", @@ -359,9 +304,9 @@ "hash": "6583c78c26b1e1e84a2ea9d40efadaf4", "errors": false }, - "\/components\/ranks\/index.php": { - "size": 20, - "hash": "934b3e85adf4c88780aeefcee899aa1b", + "\/components\/ranks\/includes\/shortcodes.php": { + "size": 1236, + "hash": "f0298e91f9f3627209e061b00e6aafdf", "errors": false }, "\/components\/ranks\/install.php": { @@ -379,14 +324,14 @@ "hash": "b327d9c19b5b1c7dfb1a6f8b10c54d53", "errors": false }, - "\/includes\/uninstall-bootstrap.php": { - "size": 365, - "hash": "eb1d53accfa1baaddc0dcfcf60ed3065", + "\/includes\/class-shortcode.php": { + "size": 8132, + "hash": "f1fc7c7b8d5bc55919f1ff7fb713c758", "errors": false }, "\/includes\/class-un-installer-base.php": { - "size": 11882, - "hash": "2b976c8776b48f24d4223758ff05c54f", + "size": 11881, + "hash": "e53cb50fe6b81e87b645d50fd89487ee", "errors": false }, "\/includes\/class-un-installer.php": { @@ -394,44 +339,64 @@ "hash": "fc1cc532de7dfd5b86cc1c86c572047d", "errors": false }, - "\/components\/points\/includes\/class-un-installer.php": { - "size": 21098, - "hash": "4893721f4fbd66f2759db0a835a96d54", + "\/includes\/class-widget.php": { + "size": 4256, + "hash": "e1f4cca75c3f285efde108e98fc859cc", "errors": false }, - "\/components\/ranks\/includes\/class-un-installer.php": { - "size": 2482, - "hash": "4dbe09f394361165f9ac44e0ebf56b7c", + "\/includes\/class-wordpoints-components.php": { + "size": 15054, + "hash": "cae5aa64a9076a575e3090a620770155", "errors": false }, - "\/components\/ranks\/includes\/deprecated.php": { - "size": 666, - "hash": "16945f69526feb24e66f314b1f9173bf", + "\/includes\/constants.php": { + "size": 640, + "hash": "ab580fd600021b52e7ebde17995ab736", "errors": false }, - "\/components\/points\/includes\/hooks\/abstracts\/comment-approved.php": { - "size": 9420, - "hash": "1a681d23c1387be3940507054739e59c", + "\/includes\/deprecated.php": { + "size": 11243, + "hash": "d596efc6bd6d554fdf369db66b59d870", "errors": false }, - "\/components\/points\/includes\/hooks\/comment-received.php": { - "size": 2335, - "hash": "810a243313f4eff732ee5d91bffc5909", + "\/includes\/functions.php": { + "size": 23666, + "hash": "60d678bd86014057f890f741af5ed395", "errors": false }, - "\/components\/ranks\/includes\/shortcodes.php": { - "size": 1236, - "hash": "f0298e91f9f3627209e061b00e6aafdf", + "\/includes\/modules.php": { + "size": 33969, + "hash": "67b9531d5cbcb4eba41ecb54329c8461", "errors": false }, - "\/includes\/class-shortcode.php": { - "size": 8132, - "hash": "f1fc7c7b8d5bc55919f1ff7fb713c758", + "\/includes\/scripts.php": { + "size": 1403, + "hash": "7ac6252eacd03211fc7dbb910e888f29", "errors": false }, - "\/includes\/class-widget.php": { - "size": 4256, - "hash": "e1f4cca75c3f285efde108e98fc859cc", + "\/includes\/uninstall-bootstrap.php": { + "size": 365, + "hash": "eb1d53accfa1baaddc0dcfcf60ed3065", + "errors": false + }, + "\/includes\/update.php": { + "size": 769, + "hash": "507b3392245feee8425e0d8d6fae6c20", + "errors": false + }, + "\/install.php": { + "size": 243, + "hash": "763323680611d8d99eb982e62075beb4", + "errors": false + }, + "\/uninstall.php": { + "size": 498, + "hash": "35915582c6a9f8d93298324711d4327e", + "errors": false + }, + "\/wordpoints.php": { + "size": 5145, + "hash": "604f66584697dba68e0c6fbd25d2294f", "errors": false } } \ No newline at end of file diff --git a/tools/wp-l10n-validator/ignores-cache.json b/tools/wp-l10n-validator/ignores-cache.json index 2d4e2097..b4197319 100644 --- a/tools/wp-l10n-validator/ignores-cache.json +++ b/tools/wp-l10n-validator/ignores-cache.json @@ -1,13 +1,24 @@ { "\/components\/points\/includes\/class-un-installer.php": { "network": { - "494": false + "495": false, + "724": false }, "standard": { - "497": false + "498": false, + "727": false }, "post": { - "733": false + "734": false + }, + "EXISTS": { + "841": { + "name": "array", + "type": "unknown", + "args_started": true, + "arg_count": 1, + "parentheses": 1 + } } }, "\/components\/points\/install.php": { @@ -59,7 +70,7 @@ }, "\/admin\/admin.php": { "upload": { - "409": { + "421": { "name": "array", "type": "unknown", "args_started": true, @@ -73,42 +84,50 @@ "22": false } }, - "upload": { - "409": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 3, - "parentheses": 1 - } - }, - "network": { - "482": false, - "490": false, - "387": false, - "459": false, - "518": false, - "553": false, - "723": false, - "394": false, - "466": false, - "525": false, - "560": false - }, - "standard": { - "484": false, - "493": false, - "389": false, - "461": false, - "520": false, - "555": false, - "726": false, - "396": false, - "468": false, - "527": false, - "562": false - }, "\/admin\/includes\/class-wordpoints-modules-list-table.php": { + "all": { + "57": false, + "216": false + }, + "active": { + "59": { + "name": "array", + "type": "unknown", + "args_started": true, + "arg_count": 0, + "parentheses": 1 + }, + "514": false + }, + "inactive": { + "59": { + "name": "array", + "type": "unknown", + "args_started": true, + "arg_count": 1, + "parentheses": 1 + }, + "514": false + }, + "search": { + "59": { + "name": "array", + "type": "unknown", + "args_started": true, + "arg_count": 3, + "parentheses": 1 + }, + "187": false + }, + "plugins": { + "91": { + "name": "array", + "type": "unknown", + "args_started": true, + "arg_count": 2, + "parentheses": 1 + } + }, "second module-version-author-uri\">": { "574": false }, @@ -118,10 +137,10 @@ }, "\/admin\/screens\/configure-components.php": { "deactivate": { - "109": false + "102": false }, "activate": { - "114": false + "107": false } }, "\/admin\/screens\/modules-load.php": { @@ -129,13 +148,13 @@ "13": false }, "1": { - "380": false + "394": false }, "delete-selected": { - "380": false + "394": false }, "compatibility-problems": { - "453": { + "463": { "name": "array", "type": "unknown", "args_started": true, @@ -165,16 +184,16 @@ }, "\/components\/points\/includes\/class-wordpoints-points-hook.php": { "network": { - "370": false, - "442": false, - "501": false, - "536": false + "394": false, + "466": false, + "525": false, + "560": false }, "standard": { - "372": false, - "444": false, - "503": false, - "538": false + "396": false, + "468": false, + "527": false, + "562": false } }, "\/components\/points\/includes\/class-wordpoints-points-hooks.php": { @@ -200,10 +219,10 @@ "434": false }, ":": { - "594": false + "596": false }, "points-": { - "669": { + "673": { "name": "array", "type": "unknown", "args_started": true, @@ -212,7 +231,7 @@ } }, "-save": { - "669": { + "673": { "name": "array", "type": "unknown", "args_started": true, @@ -221,10 +240,10 @@ } }, "\" class=\"hook": { - "742": false + "746": false }, "-savehook": { - "775": { + "779": { "name": "array", "type": "unknown", "args_started": true, @@ -235,7 +254,6 @@ }, "\/components\/points\/includes\/hooks\/abstracts\/comment-approved.php": { "approved": { - "152": false, "159": false }, "new": { @@ -244,7 +262,7 @@ }, "\/components\/points\/includes\/logs.php": { "points": { - "256": { + "255": { "name": "array", "type": "unknown", "args_started": true, @@ -253,7 +271,7 @@ } }, "text": { - "256": { + "255": { "name": "array", "type": "unknown", "args_started": true, @@ -262,7 +280,7 @@ } }, "date": { - "256": { + "255": { "name": "array", "type": "unknown", "args_started": true, @@ -284,7 +302,7 @@ }, "\/components\/points\/includes\/shortcodes.php": { "default": { - "154": { + "159": { "name": "array", "type": "unknown", "args_started": true, @@ -303,26 +321,20 @@ "parentheses": 1 } }, + ": %points%": { + "158": false + }, "1": { "425": false, "550": false } }, "\/includes\/functions.php": { - "get": { - "135": { - "name": "wordpoints_verify_nonce", - "type": "unknown", - "args_started": true, - "arg_count": 3, - "parentheses": 1 - } - }, "-1": { - "467": false + "518": false }, "points": { - "761": { + "814": { "name": "array", "type": "unknown", "args_started": true, @@ -331,7 +343,7 @@ } }, "ranks": { - "786": { + "839": { "name": "array", "type": "unknown", "args_started": true, @@ -340,71 +352,6 @@ } } }, - "0": { - "388": false - }, - "delete-selected": { - "388": false, - "394": false - }, - "compatibility-problems": { - "457": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 0, - "parentheses": 1 - }, - "463": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 0, - "parentheses": 1 - } - }, - "points-": { - "671": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 0, - "parentheses": 1 - } - }, - "-save": { - "671": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 0, - "parentheses": 1 - } - }, - "\" class=\"hook": { - "744": false - }, - "-savehook": { - "777": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 0, - "parentheses": 1 - } - }, - "default": { - "159": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 1, - "parentheses": 1 - } - }, - ": %points%": { - "158": false - }, "\/admin\/screens\/modules.php": { "module": { "34": { @@ -457,7 +404,7 @@ }, "\/components\/points\/includes\/hooks\/comment-removed.php": { "approved": { - "133": false + "136": false } }, "\/components\/ranks\/admin\/includes\/ajax.php": { @@ -473,7 +420,7 @@ }, "\/includes\/modules.php": { "Module Name": { - "391": { + "392": { "name": "array", "type": "unknown", "args_started": true, @@ -482,7 +429,7 @@ } }, "Module URI": { - "392": { + "393": { "name": "array", "type": "unknown", "args_started": true, @@ -491,7 +438,7 @@ } }, "Version": { - "393": { + "394": { "name": "array", "type": "unknown", "args_started": true, @@ -500,7 +447,7 @@ } }, "Description": { - "394": { + "395": { "name": "array", "type": "unknown", "args_started": true, @@ -509,7 +456,7 @@ } }, "Author": { - "395": { + "396": { "name": "array", "type": "unknown", "args_started": true, @@ -518,7 +465,7 @@ } }, "Author URI": { - "396": { + "397": { "name": "array", "type": "unknown", "args_started": true, @@ -527,7 +474,7 @@ } }, "Text Domain": { - "397": { + "398": { "name": "array", "type": "unknown", "args_started": true, @@ -536,7 +483,7 @@ } }, "Domain Path": { - "398": { + "399": { "name": "array", "type": "unknown", "args_started": true, @@ -545,7 +492,7 @@ } }, "Network": { - "399": { + "400": { "name": "array", "type": "unknown", "args_started": true, @@ -554,7 +501,7 @@ } }, "Update API": { - "400": { + "401": { "name": "array", "type": "unknown", "args_started": true, @@ -562,8 +509,8 @@ "parentheses": 1 } }, - "ID": { - "401": { + "Channel": { + "402": { "name": "array", "type": "unknown", "args_started": true, @@ -571,51 +518,17 @@ "parentheses": 1 } }, - "true": { - "406": false - } - }, - "second module-version-author-uri\">": { - "552": false - }, - "column-": { - "601": false - }, - "1": { - "394": false - }, - "module": { - "36": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 0, - "parentheses": 1 - } - }, - "points": { - "775": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 0, - "parentheses": 1 + "ID": { + "403": { + "name": "array", + "type": "unknown", + "args_started": true, + "arg_count": 11, + "parentheses": 1 + } }, - "255": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 2, - "parentheses": 1 - } - }, - "ranks": { - "800": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 0, - "parentheses": 1 + "true": { + "412": false } }, "\/components\/points\/includes\/hooks\/periodic.php": { @@ -629,7 +542,7 @@ } }, "widefat wordpoints-append-to-hook-title": { - "228": { + "231": { "name": "array", "type": "unknown", "args_started": true, @@ -640,40 +553,21 @@ }, "\/components\/ranks\/includes\/class-wordpoints-rank-type.php": { "value=\"<% if ( typeof": { - "212": false + "220": false }, "!== \"undefined\" ) { print(": { - "212": false + "220": false }, "); } %>\"": { - "212": false + "220": false }, "value=\"": { - "214": false + "222": false }, "class=\"widefat\"\n\t\t\t\t\t\/>": { - "216": false - } - }, - "text": { - "255": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 5, - "parentheses": 1 + "224": false } }, - "date": { - "255": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 6, - "parentheses": 1 - }, - "617": false - }, "\/components\/points\/includes\/class-wordpoints-points-logs-query.php": { "text": { "41": { @@ -708,7 +602,7 @@ "arg_count": 3, "parentheses": 1 }, - "601": false + "617": false }, "all": { "238": { @@ -736,7 +630,7 @@ } }, "results": { - "375": { + "391": { "name": "array", "type": "unknown", "args_started": true, @@ -745,7 +639,7 @@ } }, "row": { - "375": { + "391": { "name": "array", "type": "unknown", "args_started": true, @@ -754,7 +648,7 @@ } }, "col": { - "375": { + "391": { "name": "array", "type": "unknown", "args_started": true, @@ -763,7 +657,7 @@ } }, "var": { - "375": { + "391": { "name": "array", "type": "unknown", "args_started": true, @@ -775,7 +669,7 @@ "645": false }, "<": { - "879": { + "895": { "name": "array", "type": "unknown", "args_started": true, @@ -784,130 +678,18 @@ } }, ",": { - "1001": false + "1017": false }, "CAST(": { "1034": false }, ".meta_value AS": { - "1034": false + "1050": false }, "ORDER BY": { "1047": false } }, - "results": { - "391": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 0, - "parentheses": 1 - } - }, - "row": { - "391": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 1, - "parentheses": 1 - } - }, - "col": { - "391": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 2, - "parentheses": 1 - } - }, - "var": { - "391": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 3, - "parentheses": 1 - } - }, - "FROM `": { - "661": false - }, - "<": { - "895": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 1, - "parentheses": 1 - } - }, - "LIKE": { - "909": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 3, - "parentheses": 1 - } - }, - ",": { - "1017": false - }, - "CAST(": { - "1050": false - }, - ".meta_value AS": { - "1050": false - }, - "ORDER BY": { - "1063": false - }, - "all": { - "57": false, - "216": false - }, - "active": { - "59": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 0, - "parentheses": 1 - }, - "514": false - }, - "inactive": { - "59": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 1, - "parentheses": 1 - }, - "514": false - }, - "search": { - "59": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 3, - "parentheses": 1 - }, - "187": false - }, - "plugins": { - "91": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 2, - "parentheses": 1 - } - }, "\/components\/ranks\/admin\/screens\/ranks.php": { "name": { "30": { @@ -951,13 +733,6 @@ } }, "points": { - "102": { - "name": "array", - "type": "unknown", - "args_started": true, - "arg_count": 0, - "parentheses": 1 - }, "123": { "name": "array", "type": "unknown", @@ -978,15 +753,6 @@ } } }, - "approved": { - "167": false, - "174": false, - "136": false, - "159": false - }, - "new": { - "168": false - }, "\/components\/points\/includes\/hooks\/abstracts\/post-type.php": { "see bug #23268 (fixed in 3.9)": { "120": { @@ -998,10 +764,10 @@ } }, "\" type=\"checkbox\" value=\"1\"": { - "324": false + "323": false }, "1": { - "324": { + "323": { "name": "checked", "type": "unknown", "args_started": true, @@ -1009,5 +775,41 @@ "parentheses": 1 } } + }, + "\/admin\/includes\/class-wordpoints-module-installer-skin.php": { + "upload": { + "56": { + "name": "array", + "type": "unknown", + "args_started": true, + "arg_count": 0, + "parentheses": 1 + } + } + }, + "\/admin\/screens\/module-install.php": { + "upload": { + "13": false + } + }, + "\/components\/ranks\/admin\/admin.php": { + "adding-editing": { + "116": { + "name": "array", + "type": "unknown", + "args_started": true, + "arg_count": 0, + "parentheses": 1 + } + }, + "deleting": { + "127": { + "name": "array", + "type": "unknown", + "args_started": true, + "arg_count": 0, + "parentheses": 1 + } + } } } \ No newline at end of file diff --git a/wp-l10n-validator.json b/wp-l10n-validator.json index 6f36fc93..fbc44e40 100644 --- a/wp-l10n-validator.json +++ b/wp-l10n-validator.json @@ -1,7 +1,7 @@ { "textdomain": { "wordpoints": true, "default": true }, "basedir": "./src", - "bootstrap": "vendor/wordpoints/l10n-validator-config/bootstrap.php", + "bootstrap": "dev-lib-wordpoints/l10n-validator/bootstrap.php", "cache": "./tools/wp-l10n-validator/cache.json", "ignores-cache": "./tools/wp-l10n-validator/ignores-cache.json", "ignores-tolerance": 25,