Skip to content
Snippets Groups Projects
Commit 0f64e9e4 authored by dyszczo's avatar dyszczo
Browse files

updated version for 2019 ;)

parent 8326defc
No related branches found
No related tags found
2 merge requests!36Devel,!33updated version for 2019 ;)
Showing
with 7 additions and 2217 deletions
...@@ -2,4 +2,3 @@ ...@@ -2,4 +2,3 @@
.idea .idea
build-coverage build-coverage
*.phar *.phar
composer.lock
\ No newline at end of file
variables: variables:
WPDESK_CI_VERSION: 1.10.19 DISABLE_PHP_5_5: 1
MYSQL_ROOT_PASSWORD: mysql DISABLE_ACCEPTANCE: "1"
MYSQL_DATABASE: wptest DISABLE_FUNCTIONAL: "1"
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql
MYSQL_INNODB_LOG_BUFFER_SIZE: 32M
PHP_ERROR_REPORTING: E_ALL
COMPOSER_ALLOW_SUPERUSER: 1
GIT_STRATEGY: fetch
ACCEPTANCE_ERROR_PATH: ${CI_PROJECT_DIR}/acceptance
stages: include: 'https://gitlab.com/wpdesk/gitlab-ci/raw/master/gitlab-ci-shop.yml'
- tools \ No newline at end of file
- tests
- pre-deploy
- deploy
.template: &job-test-template
stage: tests
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
.template: &job-test-integration-template
<<: *job-test-template
services:
- mysql:5.6
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- composer update --no-progress
- if [[ -f tests/integration/prepare.sh ]]; then sh tests/integration/prepare.sh; fi
- vendor/bin/phpunit --configuration phpunit-integration.xml --coverage-text --colors=never
only:
- tags
.template: &job-test-integration-template-fast
<<: *job-test-integration-template
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- composer update --no-progress
- if [[ -f tests/integration/prepare.sh ]]; then sh tests/integration/prepare.sh; fi
- vendor/bin/phpunit --configuration phpunit-integration.xml --no-coverage
except:
- tags
only:
.template: &job-test-unit-template
<<: *job-test-template
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- composer update --no-progress
- vendor/bin/phpunit --configuration phpunit-unit.xml --coverage-text --colors=never
only:
- tags
.template: &job-test-unit-template-fast
<<: *job-test-unit-template
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- composer update --no-progress
- vendor/bin/phpunit --configuration phpunit-unit.xml --no-coverage
except:
- tags
only:
.template: &job-deploy-template
image: wpdesknet/amazon-svn-deploy
stage: deploy
dependencies:
- build to deploy
- unit test lastest coverage
- integration test lastest coverage
retry: 2
when: manual
only:
- tags
before_script:
- cd ${CI_PROJECT_DIR}
phpmetric metrics:
stage: tools
image: wpdesknet/phpunit-woocommerce:0-0
allow_failure: true
when: manual
artifacts:
when: always
expire_in: 1 month
name: "metrics"
paths:
- ${CI_PROJECT_DIR}/phpmetric
script:
- echo ${WPDESK_CI_VERSION}
- composer require phpmetrics/phpmetrics
- composer update --no-progress
- php ./vendor/bin/phpmetrics --report-html=phpmetric .
churn metrics:
stage: tools
image: wpdesknet/phpunit-woocommerce:0-0
allow_failure: true
when: manual
script:
- echo ${WPDESK_CI_VERSION}
- composer require bmitch/churn-php
- composer update --no-progress
- vendor/bin/churn run classes inc
#code style test:
# stage: tests
# image: wpdesknet/phpunit-woocommerce:0-0
# allow_failure: true
# script:
# - echo ${WPDESK_CI_VERSION}
# - composer update --no-progress
# - vendor/bin/phpcs
unit test lastest:
<<: *job-test-unit-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
integration test lastest:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
unit test lastest coverage:
<<: *job-test-unit-template
image: wpdesknet/phpunit-woocommerce:0-0
integration test lastest coverage:
<<: *job-test-integration-template
image: wpdesknet/phpunit-woocommerce:0-0
integration test php7-1 wc-1:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:1-1
integration test php7 wc-2:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:2-2
integration test php-7 wc-3:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:2-3
integration test php5-6:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:3-0
integration test php5-5:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:4-0
integration test current woocommerce:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
allow_failure: true
before_script:
- cd /tmp
- rm -rf woocommerce
- git clone https://github.com/woocommerce/woocommerce.git
- cd ${CI_PROJECT_DIR}
acceptance test:
image: wpdesknet/node
variables:
CI_DEBUG_SERVICES: trace
services:
- name: mysql:5.6
alias: mysqltests
- name: wpdesknet/apache-woocommerce:latest
alias: wootests
- name: selenium/standalone-chrome
alias: selenium
artifacts:
when: always
expire_in: 1 day
name: "error logs"
paths:
- ${CI_PROJECT_DIR}/acceptance
stage: tests
allow_failure: true
script:
- cd ${CI_PROJECT_DIR}
- composer update --no-progress --no-dev
- if [[ -f ${CI_PROJECT_DIR}/tests/acceptance/prepare.sh ]]; then sh ${CI_PROJECT_DIR}/tests/acceptance/prepare.sh; fi
- export MYSQL_IP=$(awk '/^[[:space:]]*($|#)/{next} /mysqltests/{print $1; exit}' /etc/hosts)
- export WOOTESTS_IP=$(awk '/^[[:space:]]*($|#)/{next} /wootests/{print $1; exit}' /etc/hosts)
- echo "http://wootests/wpdesk_init.php?mysql_ip=${MYSQL_IP}&wootests_ip=${WOOTESTS_IP}"
- wget -O /tmp/wpdesk_init.txt "http://wootests/wpdesk_init.php?mysql_ip=${MYSQL_IP}&wootests_ip=${WOOTESTS_IP}"
- tail -50 /tmp/wpdesk_init.txt
- sh /tmp/clone.sh git@gitlab.com:wpdesk/plugins-tests.git /tmp/tests headless
- cd /tmp/tests
- npm install
- npm install -g grunt-cli
- cd node_modules/.bin
- ./webdriver-manager update
- cd ../
- mkdir -p ${CI_PROJECT_DIR}/acceptance/reports/html/screenshot
- grunt chrome-${CI_PROJECT_NAME}
apigen docs:
image:
name: wpdesknet/apigen
stage: pre-deploy
artifacts:
expire_in: 1 day
name: "docs"
paths:
- docs/
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- /app/vendor/bin/apigen generate
- php /app/hooks-docs.php ${CI_PROJECT_DIR}
only:
- tags
pages:
stage: deploy
dependencies:
- apigen docs
script:
- rm -rf public
- mv docs/ public/
- 'curl -X POST --data-urlencode "payload={\"text\": \"Dokumentacja projektu ${CI_PROJECT_NAME} w wersji ${CI_COMMIT_REF_NAME} umieszczona w <https://gitlab.com/wpdesk/${CI_PROJECT_NAME}/pages|pages> \", }" https://hooks.slack.com/services/${SLACK_AUTH}'
artifacts:
expire_in: 1 day
paths:
- public
only:
- tags
build to deploy:
image: wpdesknet/phpunit-woocommerce:4-0
stage: pre-deploy
artifacts:
expire_in: 1 month
name: "production release"
paths:
- release
- release.zip
script:
- echo ${WPDESK_CI_VERSION}
- php --version
- ls -l
- /tmp/set_version.sh ${CI_COMMIT_REF_NAME}
- rm -rf ${CI_PROJECT_DIR}/release ${CI_PROJECT_DIR}/release.zip /tmp/release
- mkdir /tmp/release
- mkdir -p ${CI_PROJECT_DIR}/release/${CI_PROJECT_NAME}
- cp -rf ${CI_PROJECT_DIR}/* /tmp/release
- cp -rf /tmp/release/* ${CI_PROJECT_DIR}/release/${CI_PROJECT_NAME}
- cd ${CI_PROJECT_DIR}/release/${CI_PROJECT_NAME}
- composer install --no-dev --no-progress --optimize-autoloader
- rm -rf build-coverage release tests docs .git .editorconfig .gitignore .gitlab-ci.yml apigen.neon phpunit.xml acceptance test_soap.php .gitlab
- rm -rf composer.json composer.lock phpcs.xml.dist phpunit-integration.xml phpunit-unit.xml composer.phar wp-cli.phar
- cd ../
- zip -r -q ../release.zip ./
only:
- tags
deploy to shop:
<<: *job-deploy-template
script:
- echo ${WPDESK_CI_VERSION}
- /tmp/deploy_shop.sh ${CI_PROJECT_NAME} release.zip ${CI_PROJECT_NAME}.zip
- 'curl -X POST --data-urlencode "payload={\"text\": \"Projekt <https://gitlab.com/wpdesk/${CI_PROJECT_NAME}|${CI_PROJECT_NAME}> zdeployowany do sklepu w wersji ${CI_COMMIT_REF_NAME}\", }" https://hooks.slack.com/services/${SLACK_AUTH}'
environment:
name: wpdesk shop
url: https://wpdeskplugin.s3.amazonaws.com/${CI_PROJECT_NAME}.zip
deploy to demo:
<<: *job-deploy-template
script:
- echo ${WPDESK_CI_VERSION}
- /tmp/deploy_demo.sh release/${CI_PROJECT_NAME} ${CI_PROJECT_NAME}
- 'curl -X POST --data-urlencode "payload={\"text\": \"Projekt <https://gitlab.com/wpdesk/${CI_PROJECT_NAME}|${CI_PROJECT_NAME}> zdeployowany do demo w wersji ${CI_COMMIT_REF_NAME}\", }" https://hooks.slack.com/services/${SLACK_AUTH}'
environment:
name: wpdesk demo
url: https://demo.wpdesk.org
deploy to repository:
<<: *job-deploy-template
script:
- echo ${WPDESK_CI_VERSION}
- rm -rf /tmp/svn-repository
- mkdir /tmp/svn-repository
- /tmp/deploy_repository.sh ${CI_PROJECT_NAME} ${CI_PROJECT_DIR}/release/${CI_PROJECT_NAME} /tmp/svn-repository
- 'curl -X POST --data-urlencode "payload={\"text\": \"Projekt <https://gitlab.com/wpdesk/${CI_PROJECT_NAME}|${CI_PROJECT_NAME}> zdeployowany do repozytorium WP w wersji ${CI_COMMIT_REF_NAME}\", }" https://hooks.slack.com/services/${SLACK_AUTH}'
environment:
name: wordpress repository
url: https://downloads.wordpress.org/plugin/${CI_PROJECT_NAME}.${CI_COMMIT_REF_NAME}.zip
### Select WooCommerce version e.g: [x] 2.6
<!--- Select the WooCommerce version on which the error occurred -->
- [ ] [2.6](http://woo26.tests.wpdesk.org)
- [ ] [2.7](http://woo27.tests.wpdesk.org)
- [ ] [3.0](http://woo30.tests.wpdesk.org)
- [ ] [3.1](http://woo31.tests.wpdesk.org)
- [ ] [3.2](http://woo32.tests.wpdesk.org)
- [ ] [3.3](http://woo33.tests.wpdesk.org)
- [ ] [3.4](http://woo34.tests.wpdesk.org)
- [ ] [Stable](https://stable.wpdesk.org/)
### Select PHP version e.g: [x] 5.6
<!--- Select the PHP version on which the error occurred -->
- [ ] 5.3
- [ ] 5.5
- [ ] 5.6
- [ ] 7.1
- [ ] 7.2
## Steps to Reproduce
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
1.
2.
## Expected Behavior
<!--- Tell what should happen -->
1.
\ No newline at end of file
...@@ -2,11 +2,11 @@ destination: docs ...@@ -2,11 +2,11 @@ destination: docs
templateConfig: /app/theme-woocommerce/config.neon templateConfig: /app/theme-woocommerce/config.neon
extensions: [php] extensions: [php]
source: source:
- classes - src
exclude: exclude:
- vendor - vendor
- tests - tests
- languages - lang
charset: [UTF-8] charset: [UTF-8]
main: Wordpress plugin main: Wordpress plugin
......
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
/**
* Base plugin class for WP Desk plugins
*
* @author Grzegorz
*
*/
class WPDesk_Plugin_Template_Settings_Hooks {
private $plugin;
public function __construct( WPDesk_Plugin_1_10 $plugin ) {
$this->plugin = $plugin;
}
public function hooks() {
$func = str_replace( '-', '_', $this->plugin->get_namespace() );
// settings menu
add_filter( $func . '_menu', array( $this, 'settings_menu' ) );
// settings tabs
add_filter( $func . '_settings_tabs', array( $this, 'settings_tabs' ) );
// unsavable tabs
add_filter( $func . '_unsavable_tabs', array( $this, 'unsavable_tabs' ) );
// settings sections
add_filter( $func . '_registered_settings_sections', array( $this, 'registered_settings_sections' ) );
// settings
add_filter( $func . '_registered_settings', array( $this, 'registered_settings' ) );
// custom type hook
add_action( $func . '_thanks', array( $this, 'custom_type_thanks' ) );
}
public function get_text_domain() {
return $this->plugin->get_text_domain();
}
public function settings_menu( array $menu ) {
$menu['type'] = 'menu';
$menu['parent'] = null;
$menu['page_title'] = __( 'WP Desk Plugin Template Settings', $this->get_text_domain() );
$menu['show_title'] = true;
$menu['menu_title'] = __( 'Plugin template', $this->get_text_domain() );
$menu['capability'] = 'manage_options';
$menu['icon'] = '';
$menu['position'] = null;
return $menu;
}
public function settings_tabs() {
$tabs = array(
'welcome' => __( 'Welcome', 's214-settings-demo' ),
'fields' => __( 'Fields', 's214-settings-demo' )
);
return $tabs;
}
public function unsavable_tabs() {
$tabs = array(
'welcome'
);
return $tabs;
}
public function registered_settings_sections() {
$sections = array(
'welcome' => array(
'main' => __( 'Welcome Aboard!', 's214-settings-demo' )
),
'fields' => array(
'text' => __( 'Text Fields', 's214-settings-demo' ),
'option' => __( 'Option Fields', 's214-settings-demo' ),
'misc' => __( 'Misc Fields', 's214-settings-demo' ),
'advanced' => __( 'Advanced Fields', 's214-settings-demo' )
)
);
return $sections;
}
function custom_type_thanks() {
$html = '<p>' . sprintf( __( 'The S214 Settings library is significantly inspired by and based on the awesome word done by %s and the team from %s, so we owe them a <strong>huge</strong> thank you!', 's214-settings-demo' ), '<a href="http://pippinsplugins.com" target="_blank">Pippin Williamson</a>', '<a href="https://easydigitaldownloads.com">Easy Digital Downloads</a>' ) . '</p>';
$html .= '<hr />';
$html .= '<p>' . sprintf( __( 'By the way, even though this <em>looks</em> like a %s field, it\'s actually an example of a \'hook\' field. It is created by attaching an action to the hook %s (in our case, %s).', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#descriptive_text-implements-a-descriptive-text-field" target="_blank"><code>descriptive_text</code></a>', '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#hook-implements-a-custom-field-through-a-wordpress-action" target="_blank">hook</a>', '<code>{your_plugin}_{field_id}</code>', '<code>s214_settings_demo_thanks</code>' ) . '</p>';
$html .= '<p>' . sprintf( __( 'You\'ll also note that this tab doesn\'t have a save button. This is achieved by filtering %s, and adding the slug of the tab to the returned array.', 's214-settings-demo' ), '<code>{your_plugin}_unsavable_tabs</code>' ) . '</p>';
echo $html;
}
public function registered_settings( $settings ) {
$plugin_settings = array(
'welcome' => array(
'main' => array(
array(
'id' => 'welcome_header',
'name' => __( 'Welcome Aboard!', 's214-settings-demo' ),
'desc' => '',
'type' => 'header'
),
array(
'id' => 'welcome_note',
'name' => '',
'desc' => sprintf( __( 'This plugin will attempt to familiarize you with the various things this library is capable of. Just in case it wasn\'t obvious, the "Welcome Aboard" text above is an example of a %s field, and this field is a %s field. Remember, every field takes \'id\', \'name\', \'desc\' and \'type\' arguments!', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#header-implements-a-simple-header" target="_blank"><code>header</code></a>', '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#descriptive_text-implements-a-descriptive-text-field" target="_blank"><code>descriptive_text</code></a>' ),
'type' => 'descriptive_text',
'tooltip_title' => __( 'Hi There!', 's214-settings-demo' ),
'tooltip_desc' => __( 'Other than the \'header\' and \'hook\' field types, all fields can display a tooltip. Do this by adding \'tooltip_title\' and \'tooltip_desc\' arguments to the field array.', 's214-settings-demo' )
),
array(
'id' => 'thanks',
'name' => __( 'Thanks EDD!', 's214-settings-demo' ),
'desc' => '',
'type' => 'hook'
)
)
),
'fields' => array(
'text' => array(
array(
'id' => 'text_header',
'name' => __( 'Text Field Examples', 's214-settings-demo' ),
'desc' => '',
'type' => 'header'
),
array(
'id' => 'text',
'name' => sprintf( __( '%s Field', 's214-settings-demo' ), 'text' ),
'desc' => sprintf( __( 'Text fields can take \'std\', \'readonly\' and \'size\' arguements. Read more about text fields %s.', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#text-implements-a-text-field" target="_blank">' . __( 'here', 's214-settings-demo' ) . '</a>' ),
'type' => 'text',
'std' => 'This is a text field'
),
array(
'id' => 'textarea',
'name' => sprintf( __( '%s Field', 's214-settings-demo' ), 'textarea' ),
'desc' => sprintf( __( 'Textarea fields can take a \'std\' arguement. Read more about textarea fields %s.', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#textarea-implements-a-text-area" target="_blank">' . __( 'here', 's214-settings-demo' ) . '</a>' ),
'type' => 'textarea'
),
array(
'id' => 'editor',
'name' => sprintf( __( '%s Field', 's214-settings-demo' ), 'editor' ),
'desc' => sprintf( __( 'Editor fields can take \'std\', \'allow_blank\', \'size\', \'wpautop\', \'buttons\' and \'teeny\' arguements. Read more about editor fields %s.', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#editor-implements-a-rich-text-editor" target="_blank">' . __( 'here', 's214-settings-demo' ) . '</a>' ),
'type' => 'editor'
),
array(
'id' => 'html',
'name' => sprintf( __( '%s Field', 's214-settings-demo' ), 'html' ),
'desc' => sprintf( __( 'HTML fields can take a \'std\' arguement. Read more about HTML fields %s.', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#html-implements-a-codemirror-html-field" target="_blank">' . __( 'here', 's214-settings-demo' ) . '</a>' ),
'type' => 'html'
),
array(
'id' => 'password',
'name' => sprintf( __( '%s Field', 's214-settings-demo' ), 'password' ),
'desc' => sprintf( __( 'Password fields can take \'std\' and \'size\' arguements. Read more about password fields %s.', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#password-implements-a-password-field" target="_blank">' . __( 'here', 's214-settings-demo' ) . '</a>' ),
'type' => 'password'
)
),
'option' => array(
array(
'id' => 'option_header',
'name' => __( 'Option Field Examples', 's214-settings-demo' ),
'desc' => '',
'type' => 'header'
),
array(
'id' => 'checkbox',
'name' => sprintf( __( '%s Field', 's214-settings-demo' ), 'checkbox' ),
'desc' => sprintf( __( 'Checkbox fields only take the basic arguements. Read more about checkbox fields %s.', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#checkbox-implements-a-checkbox" target="_blank">' . __( 'here', 's214-settings-demo' ) . '</a>' ),
'type' => 'checkbox'
),
array(
'id' => 'multicheck',
'name' => sprintf( __( '%s Field', 's214-settings-demo' ), 'multicheck' ),
'desc' => sprintf( __( 'Multicheck fields only take the basic arguements. Read more about multicheck fields %s.', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#multicheck-implements-a-multicheck-field" target="_blank">' . __( 'here', 's214-settings-demo' ) . '</a>' ),
'type' => 'multicheck',
'options' => array(
'option1' => __( 'Option 1', 's214-settings-demo' ),
'option2' => __( 'Option 2', 's214-settings-demo' ),
'option3' => __( 'Option 3', 's214-settings-demo' )
)
),
array(
'id' => 'radio',
'name' => sprintf( __( '%s Field', 's214-settings-demo' ), 'radio' ),
'desc' => sprintf( __( 'Radio fields can take a \'std\' arguement. Read more about radio fields %s.', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#radio-implements-a-radio-button-list-field" target="_blank">' . __( 'here', 's214-settings-demo' ) . '</a>' ),
'type' => 'radio',
'options' => array(
'option1' => __( 'Option 1', 's214-settings-demo' ),
'option2' => __( 'Option 2', 's214-settings-demo' ),
'option3' => __( 'Option 3', 's214-settings-demo' )
)
),
array(
'id' => 'select',
'name' => sprintf( __( '%s Field', 's214-settings-demo' ), 'select' ),
'desc' => sprintf( __( 'Select fields can take \'std\', \'placeholder\', \'select2\' and \'multiple\' arguements. Read more about select fields %s.', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#select-implements-a-select-field" target="_blank">' . __( 'here', 's214-settings-demo' ) . '</a>' ),
'type' => 'select',
'options' => array(
'option1' => __( 'Option 1', 's214-settings-demo' ),
'option2' => __( 'Option 2', 's214-settings-demo' ),
'option3' => __( 'Option 3', 's214-settings-demo' )
)
)
),
'misc' => array(
array(
'id' => 'misc_header',
'name' => __( 'Misc Field Examples', 's214-settings-demo' ),
'desc' => '',
'type' => 'header'
),
array(
'id' => 'color',
'name' => sprintf( __( '%s Field', 's214-settings-demo' ), 'color' ),
'desc' => sprintf( __( 'Color fields can take a \'std\' arguement. Read more about color fields %s.', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#color-implements-a-color-select-field" target="_blank">' . __( 'here', 's214-settings-demo' ) . '</a>' ),
'type' => 'color',
'std' => '#000000'
),
array(
'id' => 'number',
'name' => sprintf( __( '%s Field', 's214-settings-demo' ), 'number' ),
'desc' => sprintf( __( 'Number fields can take \'std\', \'max\', \'min\', \'step\', \'size\' and \'readonly\' arguements. Read more about number fields %s.', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#number-implements-a-number-field" target="_blank">' . __( 'here', 's214-settings-demo' ) . '</a>' ),
'type' => 'number',
'std' => 1227
),
array(
'id' => 'upload',
'name' => sprintf( __( '%s Field', 's214-settings-demo' ), 'upload' ),
'desc' => sprintf( __( 'Upload fields can take \'std\' and \'size\' arguements. Read more about upload fields %s.', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#upload-implements-an-upload-field" target="_blank">' . __( 'here', 's214-settings-demo' ) . '</a>' ),
'type' => 'upload'
)
),
'advanced' => array(
array(
'id' => 'advanced_header',
'name' => __( 'Advanced Field Examples', 's214-settings-demo' ),
'desc' => '',
'type' => 'header'
),
array(
'id' => 'sysinfo',
'name' => sprintf( __( '%s Field', 's214-settings-demo' ), 'sysinfo' ),
'desc' => sprintf( __( 'Sysinfo fields only take the basic arguements. Read more about sysinfo fields %s.', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#sysinfo-implements-a-system-info-display-field" target="_blank">' . __( 'here', 's214-settings-demo' ) . '</a>' ),
'type' => 'sysinfo',
'tab' => 'advanced'
)
)
)
);
return array_merge( $settings, $plugin_settings );
}
}
<?php
require_once( 'wpdesk/class-plugin.php' );
require_once( 'wpdesk/interface-plugin-factory.php' );
require_once( 'plugin-template-plugin.php' );
final class WPDesk_Plugin_Template_Factory implements WPDesk_Plugin_Factory_1_10 {
const PHP_EXTENSION = '.php';
/** @var WPDesk_Plugin_Template_Plugin */
private static $instance = null;
/**
* Builds instance of plugin. If called more than once then more than one instance is created.
*
* @return WPDesk_Plugin_Template_Plugin
*/
public static function build_plugin() {
$wpdesk_plugin_template_plugin_data = array(
'plugin' => plugin_basename( __FILE__ ),
'product_id' => 'WP Desk Plugin Template',
'version' => PLUGIN_TEMPLATE_VERSION,
'config_uri' => admin_url( 'edit.php?post_type=inspire_invoice&page=plugin_template' )
);
$class_name = apply_filters( self::WPDESK_FILTER_PLUGIN_CLASS, WPDesk_Plugin_Template_Plugin::class );
$plugin_dir = dirname( dirname( __FILE__ ) );
$plugin_file = trailingslashit( $plugin_dir ) . basename( $plugin_dir ) . self::PHP_EXTENSION;
return new $class_name( $plugin_file, $wpdesk_plugin_template_plugin_data );
}
/**
* Builds instance if needed and ensures there is only one instance.
*
* @return WPDesk_Plugin_Template_Plugin
*/
public static function get_plugin_instance() {
if ( empty( self::$instance ) ) {
self::$instance = self::build_plugin();
}
return self::$instance;
}
}
\ No newline at end of file
<?php
require_once( 'wpdesk/class-plugin.php' );
class WPDesk_Plugin_Template_Plugin extends WPDesk_Plugin_1_10 {
/**
* WPDesk_Plugin_Template_Plugin constructor.
*
* @param array $plugin_data
*/
public function __construct( $base_file, $plugin_data ) {
$this->plugin_namespace = 'plugin-template';
$this->plugin_text_domain = 'plugin-template';
$this->plugin_has_settings = true;
$this->default_settings_tab = 'welcome';
if ( is_array( $plugin_data ) && count( $plugin_data ) ) {
if ( ! class_exists( 'WPDesk_Helper_Plugin' ) ) {
require_once( 'wpdesk/class-helper.php' );
add_filter( 'plugins_api', array( $this, 'wpdesk_helper_install' ), 10, 3 );
add_action( 'admin_notices', array( $this, 'wpdesk_helper_notice' ) );
}
$helper = new WPDesk_Helper_Plugin( $plugin_data );
if ( ! $helper->is_active() ) {
$this->plugin_is_active = false;
}
}
parent::__construct( $base_file, $plugin_data );
if ( $this->plugin_is_active() ) {
require_once 'class-plugin-template-settings-hooks.php';
$this->settings_hooks = new WPDesk_Plugin_Template_Settings_Hooks( $this );
$this->settings_hooks->hooks();
$this->init();
$this->hooks();
}
}
public function init() {
}
public function hooks() {
parent::hooks();
}
/**
* Helper functions
*/
/**
* Load installer for the WP Desk Helper.
* @return $api Object
*/
public function wpdesk_helper_install( $api, $action, $args ) {
$download_url = 'http://www.wpdesk.pl/wp-content/uploads/wpdesk-helper.zip';
if ( 'plugin_information' != $action ||
false !== $api ||
! isset( $args->slug ) ||
'wpdesk-helper' != $args->slug
) {
return $api;
}
$api = new stdClass();
$api->name = 'WP Desk Helper';
$api->version = '1.0';
$api->download_link = esc_url( $download_url );
return $api;
}
/**
* Display a notice if the "WP Desk Helper" plugin hasn't been installed.
* @return void
*/
public function wpdesk_helper_notice() {
$active_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins' ) );
if ( in_array( 'wpdesk-helper/wpdesk-helper.php', $active_plugins ) ) {
return;
}
$slug = 'wpdesk-helper';
$install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $slug ), 'install-plugin_' . $slug );
$activate_url = 'plugins.php?action=activate&plugin=' . urlencode( 'wpdesk-helper/wpdesk-helper.php' ) . '&plugin_status=all&paged=1&s&_wpnonce=' . urlencode( wp_create_nonce( 'activate-plugin_wpdesk-helper/wpdesk-helper.php' ) );
$message = sprintf( wp_kses( __( '<a href="%s">Install the WP Desk Helper plugin</a> to activate and get updates for your WP Desk plugins.', 'wpdesk-plugin' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( $install_url ) );
$plugins = array_keys( get_plugins() );
foreach ( $plugins as $plugin ) {
if ( strpos( $plugin, 'wpdesk-helper.php' ) !== false ) {
$message = sprintf( wp_kses( __( '<a href="%s">Activate the WP Desk Helper plugin</a> to activate and get updates for your WP Desk plugins.', 'wpdesk-plugin' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( admin_url( $activate_url ) ) );
}
}
echo '<div class="error fade"><p>' . $message . '</p></div>' . "\n";
}
}
\ No newline at end of file
/* Added by WP Desk - Reset some default WP styles
-------------------------------------------------------------- */
.select2-container li {
margin-bottom: 0;
}
/* Added by WP Desk - Select2 Columns Draggable/Sortable
-------------------------------------------------------------- */
.select-2-columns .available-column,
.select-2-columns .selected-column {
background-color: #fff;
border: 1px solid #e5e5e5;
float: left;
margin-right: 20px;
padding: 12px 14px;
max-width: 450px;
}
.select-2-columns > div > strong {
display: block;
margin-bottom: 10px;
}
.select-2-columns ul {
margin: 0;
min-height: 50px;
min-width: 200px;
}
.select-2-columns li {
background-color: #fafafa;
border: 1px solid #e5e5e5;
cursor: move;
padding: 5px 10px;
}
.select-2-columns li:hover {
border-color: #999;
}
.select-2-columns .ui-sortable-placeholder {
background-color: transparent;
border:1px dashed #b4b9be;
visibility: visible !important;
}
/* Fix color picker label alignment
-------------------------------------------------------------- */
.s214-color-picker-label {
position: absolute;
display: inline-block;
padding-top: 4px;
}
/* System info styles
-------------------------------------------------------------- */
#system-info-textarea {
width: 800px;
height: 400px;
font-family: Menlo, Monaco, monospace;
background: none;
white-space: pre;
overflow: auto;
display: block;
}
/* Tooltips
-------------------------------------------------------------- */
.s214-help-tip {
cursor: help;
}
.ui-tooltip {
background: #333 !important;
border-radius: 3px !important;
box-shadow: 1px 1px 2px 1px rgba(214,214,214,0.5);
color: #dedede !important;
max-width: 300px;
padding: 7px;
text-rendering: optimizeLegibility;
}
.select2-container li{margin-bottom:0}.select-2-columns .available-column,.select-2-columns .selected-column{background-color:#fff;border:1px solid #e5e5e5;float:left;margin-right:20px;padding:12px 14px;max-width:450px}.select-2-columns > div > strong{display:block;margin-bottom:10px}.select-2-columns ul{margin:0;min-height:50px;min-width:200px}.select-2-columns li{background-color:#fafafa;border:1px solid #e5e5e5;cursor:move;padding:5px 10px}.select-2-columns li:hover{border-color:#999}.select-2-columns .ui-sortable-placeholder{background-color:transparent;border:1px dashed #b4b9be;visibility:visible !important}.s214-color-picker-label{position:absolute;display:inline-block;padding-top:4px}#system-info-textarea{width:800px;height:400px;font-family:Menlo, Monaco, monospace;background:none;white-space:pre;overflow:auto;display:block}.s214-help-tip{cursor:help}.ui-tooltip{background:#333 !important;border-radius:3px !important;box-shadow:1px 1px 2px 1px rgba(214,214,214,0.5);color:#dedede !important;max-width:300px;padding:7px;text-rendering:optimizeLegibility}
/*global jQuery, document, window, wp, CodeMirror, s214_settings_vars*/
jQuery(document).ready(function ($) {
'use strict';
// Setup color picker
if ($('.s214-color-picker').length) {
$('.s214-color-picker').wpColorPicker();
}
// Setup select2
if ($('.s214-select2').length) {
$('.s214-select2').select2();
}
// Setup CodeMirror
if ($('.s214-html').length) {
$('.s214-html').each(function (index, elem) {
CodeMirror.fromTextArea(elem, {
lineNumbers: true,
mode: 'text/html',
showCursorWhenSelecting: true
});
});
}
// Setup tooltips
$('.s214-help-tip').tooltip({
content: function () {
return $(this).prop('title');
},
position: {
my: 'center top',
at: 'center bottom+10',
collision: 'flipfit'
},
hide: {
duration: 200
},
show: {
duration: 200
}
});
// Setup uploaders
if ($('.' + s214_settings_vars.func + '_settings_upload_button').length) {
var file_frame;
$('body').on('click', '.' + s214_settings_vars.func + '_settings_upload_button', function (e) {
e.preventDefault();
var button = $(this);
window.formfield = $(this).parent().prev();
// If the media frame already exists, reopen it
if (file_frame) {
file_frame.open();
return;
}
// Create the media frame
wp.media.frames.file_frame = wp.media({
frame: 'post',
state: 'insert',
title: button.data('uploader_title'),
button: {
text: button.data('uploader_button_text')
},
multiple: false
});
file_frame = wp.media.frames.file_frame;
file_frame.on('menu:render:default', function (view) {
// Store our views in an object
var views = {};
// Unset default menu items
view.unset('library-separator');
view.unset('gallery');
view.unset('featured-image');
view.unset('embed');
// Initialize the views in our object
view.set(views);
});
// Run a callback on select
file_frame.on('insert', function () {
var selection = file_frame.state().get('selection');
selection.each(function (attachment) {
attachment = attachment.toJSON();
window.formfield.val(attachment.url);
});
});
// Open the modal
file_frame.open();
});
window.formfield = '';
}
});
jQuery(document).ready(function(t){"use strict";if(t(".s214-color-picker").length&&t(".s214-color-picker").wpColorPicker(),t(".s214-select2").length&&t(".s214-select2").select2(),t(".s214-html").length&&t(".s214-html").each(function(t,e){CodeMirror.fromTextArea(e,{lineNumbers:!0,mode:"text/html",showCursorWhenSelecting:!0})}),t(".s214-help-tip").tooltip({content:function(){return t(this).prop("title")},position:{my:"center top",at:"center bottom+10",collision:"flipfit"},hide:{duration:200},show:{duration:200}}),t("."+s214_settings_vars.func+"_settings_upload_button").length){var e;t("body").on("click","."+s214_settings_vars.func+"_settings_upload_button",function(n){n.preventDefault();var o=t(this);return window.formfield=t(this).parent().prev(),e?void e.open():(wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:o.data("uploader_title"),button:{text:o.data("uploader_button_text")},multiple:!1}),e=wp.media.frames.file_frame,e.on("menu:render:default",function(t){var e={};t.unset("library-separator"),t.unset("gallery"),t.unset("featured-image"),t.unset("embed"),t.set(e)}),e.on("insert",function(){var t=e.state().get("selection");t.each(function(t){t=t.toJSON(),window.formfield.val(t.url)})}),void e.open())}),window.formfield=""}});
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
if ( ! class_exists( 'WPDesk_Helper_Plugin' ) ) {
class WPDesk_Helper_Plugin {
/** @var array */
protected $plugin_data;
/** @var string */
protected $text_domain;
/** @var string */
protected $ame_activated_key;
/** @var string */
protected $ame_activation_tab_key;
/**
* @param array $plugin_data
*/
function __construct( $plugin_data ) {
global $wpdesk_helper_plugins;
$this->plugin_data = $plugin_data;
if ( ! isset( $wpdesk_helper_plugins ) ) {
$wpdesk_helper_plugins = array();
}
$plugin_data['helper_plugin'] = $this;
$wpdesk_helper_plugins[] = $plugin_data;
$this->ame_activated_key = 'api_' . dirname( $plugin_data['plugin'] ) . '_activated';
$this->ame_activation_tab_key = 'api_' . dirname( $plugin_data['plugin'] ) . '_dashboard';
}
/**
* @return void
*/
public function inactive_notice() { ?>
<?php if ( ! current_user_can( 'manage_options' ) ) {
return;
} ?>
<?php if ( 1 == 1 && isset( $_GET['page'] ) && $this->ame_activation_tab_key == $_GET['page'] ) {
return;
} ?>
<div class="update-nag">
<?php printf( __( 'The %s%s%s License Key has not been activated, so the plugin is inactive! %sClick here%s to activate the license key and the plugin.', 'wpdesk-plugin' ), '<strong>', $this->plugin_data['product_id'], '</strong>', '<a href="' . esc_url( admin_url( 'admin.php?page=' . $this->ame_activation_tab_key ) ) . '">', '</a>' ); ?>
</div>
<?php
}
/**
* @param bool $add_notice
*
* @return bool
*/
function is_active( $add_notice = false ) {
if ( get_option( $this->ame_activated_key, '0' ) != 'Activated' ) {
if ( $add_notice ) {
add_action( 'admin_notices', array( $this, 'inactive_notice' ) );
}
return false;
} else {
return true;
}
}
}
}
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
require_once 'functions.php';
if ( ! class_exists( 'WPDesk_Plugin_1_10' ) ) {
require_once 'class-settings.php';
/**
* Base plugin class for WP Desk plugins
*
* @author Grzegorz
*
*/
class WPDesk_Plugin_1_10 {
const VERSION = '1.10';
/** @var bool */
protected $plugin_is_active = true;
/** @var array */
protected $default_view_args;
/** @var string */
public $plugin_namespace = 'wpdesk_plugin';
/** @var string */
public $plugin_text_domain = 'wpdesk-plugin';
/** @var bool */
public $plugin_has_settings = false;
/** @var string */
public $plugin_path;
/** @var string */
public $template_path;
/** @var string */
public $plugin_file_path;
/** @var string */
public $plugin_url;
/** @var bool */
public $settings_url = false;
/** @var bool */
public $docs_url = false;
/** @var string */
public $default_settings_tab = 'general';
public $settings_hooks = null;
/** @var WPDesk_Settings_1_10 */
public $settings = null;
/** @var array */
public $options = null;
protected function __construct( $base_file, $plugin_data = false ) {
$this->init_base_variables( $base_file );
if ( $this->plugin_is_active ) {
if ( $this->plugin_has_settings ) {
$this->settings = new WPDesk_Settings_1_10( $this, $this->get_namespace(), $this->default_settings_tab );
$this->options = $this->settings->get_settings();
}
}
$this->hooks();
}
/**
* @return bool
*/
public function plugin_is_active() {
return $this->plugin_is_active;
}
/**
* @return WPDesk_Settings_1_10
*/
public function get_settings() {
return $this->settings;
}
/**
* @param $key
* @param $default
*
* @return mixed
*/
public function get_option( $key, $default ) {
return $this->settings->get_option( $key, $default );
}
/**
* @return $this
*/
public function get_plugin() {
return $this;
}
/**
* @return string
*/
public function get_text_domain() {
return $this->plugin_text_domain;
}
/**
* @return void
*/
public function load_plugin_text_domain() {
$wpdesk_translation = load_plugin_textdomain( 'wpdesk-plugin', false, $this->get_namespace() . '/classes/wpdesk/lang/' );
$plugin_translation = load_plugin_textdomain( $this->get_text_domain(), false, $this->get_namespace() . '/lang/' );
}
/**
* @param string $base_file
*/
public function init_base_variables( $base_file ) {
// Set Plugin Path
$this->plugin_path = dirname( $base_file );
// Set Plugin URL
$this->plugin_url = plugin_dir_url( $base_file );
$this->plugin_file_path = $base_file;
$this->template_path = $this->get_namespace();
$this->default_view_args = array(
'plugin_url' => $this->get_plugin_url()
);
}
/**
* @return void
*/
public function hooks() {
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) );
add_action( 'plugins_loaded', array( $this, 'load_plugin_text_domain' ) );
add_filter( 'plugin_action_links_' . plugin_basename( $this->get_plugin_file_path() ), array(
$this,
'links_filter'
) );
}
/**
*
* @return string
*/
public function get_plugin_url() {
return esc_url( trailingslashit( $this->plugin_url ) );
}
public function get_plugin_assets_url() {
return esc_url( trailingslashit( $this->get_plugin_url() . 'assets' ) );
}
/**
* @return string
*/
public function get_template_path() {
return trailingslashit( $this->template_path );
}
/**
* @return string
*/
public function get_plugin_file_path() {
return $this->plugin_file_path;
}
/**
* @return string
*/
public function get_namespace() {
return $this->plugin_namespace;
}
/**
* @return null
*/
public function get_settings_hooks() {
return $this->settings_hooks;
}
/**
* Renders end returns selected template
*
* @param string $name name of the template
* @param string $path additional inner path to the template
* @param array $args args accesible from template
*
* @return string
*/
public function load_template( $name, $path = '', $args = array() ) {
$plugin_template_path = trailingslashit( $this->plugin_path ) . 'templates/';
// Look within passed path within the theme - this is priority.
$template = locate_template(
array(
trailingslashit( $this->get_template_path() ) . trailingslashit( $path ) . $name . '.php',
)
);
if ( ! $template ) {
$template = $plugin_template_path . trailingslashit( $path ) . $name . '.php';
}
extract( $args );
ob_start();
include( $template );
return ob_get_clean();
}
public function admin_enqueue_scripts( $hooq ) {
}
public function wp_enqueue_scripts() {
}
/**
* action_links function.
*
* @access public
*
* @param mixed $links
*
* @return array
*/
public function links_filter( $links ) {
$support_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/support/' : 'https://www.wpdesk.net/support';
$plugin_links = array(
'<a href="' . $support_link . '">' . __( 'Support', 'wpdesk-plugin' ) . '</a>',
);
$links = array_merge( $plugin_links, $links );
if ( $this->docs_url ) {
$plugin_links = array(
'<a href="' . $this->docs_url . '">' . __( 'Docs', 'wpdesk-plugin' ) . '</a>',
);
$links = array_merge( $plugin_links, $links );
}
if ( $this->settings_url ) {
$plugin_links = array(
'<a href="' . $this->settings_url . '">' . __( 'Settings', 'wpdesk-plugin' ) . '</a>',
);
$links = array_merge( $plugin_links, $links );
}
return $links;
}
}
}
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
if ( ! class_exists( 'WPDesk_Requirement_Checker_1_10' ) ) {
/**
* Checks requirements for plugin
* have to be compatible with PHP 5.2.x
*/
class WPDesk_Requirement_Checker_1_10 {
const HOOK_PRIORITY_LOAD_AS_FIRST = -10;
/** @var string */
private $plugin_name = '';
/** @var string */
private $plugin_file = '';
/** @var string */
private $min_php_version;
/** @var string */
private $min_wp_version;
/** @var string */
private $min_wc_version;
/** @var array */
private $plugin_require;
/** @var array */
private $module_require;
/** @var array */
private $setting_require;
/** @var array */
private $notices;
/**
* @param $plugin_file
* @param $php_version
* @param $wp_version
* @param string|null $wc_version
*/
public function __construct( $plugin_file, $php_version, $wp_version, $wc_version = null ) {
$this->plugin_file = $plugin_file;
$this->plugin_name = $this->extract_plugin_title_from_header( $plugin_file );
$this->set_min_php_require( $php_version );
$this->set_min_wp_require( $wp_version );
$this->set_min_wc_require( $wc_version );
$this->plugin_require = array();
$this->module_require = array();
$this->setting_require = array();
$this->notices = array();
}
/**
* Should be used when you want to check if others plugin are loaded (WC for example)
*/
public function check_requirements_and_load_plugin_deferred() {
add_action( "plugins_loaded", array( $this, "check_requirements_and_load_plugin" ), self::HOOK_PRIORITY_LOAD_AS_FIRST );
}
/**
* Checks if requirements are met and loads bootstrap
*/
public function check_requirements_and_load_plugin() {
if ( $this->is_requirements_met() ) {
require_once plugin_dir_path( $this->plugin_file ) . DIRECTORY_SEPARATOR . 'bootstrap.php';
} else {
$this->disable_plugin_render_notice();
}
}
/**
* @param string $version
*
* @return $this
*/
public function set_min_php_require( $version ) {
$this->min_php_version = $version;
return $this;
}
/**
* @param string $version
*
* @return $this
*/
public function set_min_wp_require( $version ) {
$this->min_wp_version = $version;
return $this;
}
/**
* @param string $version
*
* @return $this
*/
public function set_min_wc_require( $version ) {
$this->min_wc_version = $version;
return $this;
}
/**
* @param string $plugin_name
* @param string $nice_plugin_name Nice plugin name for better looks in notice
*
* @return $this
*/
public function add_plugin_require( $plugin_name, $nice_plugin_name = null ) {
if ( is_null( $nice_plugin_name ) ) {
$this->plugin_require[ $plugin_name ] = $plugin_name;
} else {
$this->plugin_require[ $plugin_name ] = $nice_plugin_name;
}
return $this;
}
/**
* @param string $module_name
* @param string $nice_name Nice module name for better looks in notice
*
* @return $this
*/
public function add_php_module_require( $module_name, $nice_name = null ) {
if ( is_null( $nice_name ) ) {
$this->module_require[ $module_name ] = $module_name;
} else {
$this->module_require[ $module_name ] = $nice_name;
}
return $this;
}
/**
* @param string $setting
* @param mixed $value
*
* @return $this
*/
public function add_php_setting_require( $setting, $value ) {
$this->setting_require[ $setting ] = $value;
return $this;
}
/**
* @param string $file
*
* @return string mixed
*/
private function extract_plugin_title_from_header( $file ) {
$plugin_data = get_file_data( $file, array(
'title' => 'Plugin Name'
) );
return $plugin_data['title'];
}
/**
* @return bool
*/
public function is_requirements_met() {
$this->notices = $this->prepare_requirement_notices();
return count( $this->notices ) === 0;
}
/**
* @return array
*/
private function prepare_requirement_notices() {
$notices = array();
if ( ! $this->is_php_at_least( $this->min_php_version ) ) {
$notices[] = $this->prepare_notice_message( sprintf( __( 'The &#8220;%s&#8221; plugin cannot run on PHP versions older than %s. Please contact your host and ask them to upgrade.', 'wpdesk-plugin' ), esc_html( $this->plugin_name ), $this->min_php_version ) );
}
if ( ! $this->is_wp_at_least( $this->min_wp_version ) ) {
$notices[] = $this->prepare_notice_message( sprintf( __( 'The &#8220;%s&#8221; plugin cannot run on WordPress versions older than %s. Please update WordPress.', 'wpdesk-plugin' ), esc_html( $this->plugin_name ), $this->min_wp_version ) );
}
if ( ! is_null( $this->min_wc_version ) && ! $this->is_wc_at_least( $this->min_wc_version ) ) {
$notices[] = $this->prepare_notice_message( sprintf( __( 'The &#8220;%s&#8221; plugin cannot run on WooCommerce versions older than %s. Please update WooCommerce.', 'wpdesk-plugin' ), esc_html( $this->plugin_name ), $this->min_wc_version ) );
}
$notices = $this->append_plugin_require_notices( $notices );
$notices = $this->append_module_require_notices( $notices );
$notices = $this->append_settings_require_notices( $notices );
return $notices;
}
/**
* @param array $notices
*
* @return array
*/
private function append_module_require_notices( $notices ) {
if ( count( $this->module_require ) > 0 ) {
foreach ( $this->module_require as $module_name => $nice_module_name ) {
if ( ! $this->is_module_active( $module_name ) ) {
$notices[] = $this->prepare_notice_message( sprintf( __( 'The &#8220;%s&#8221; plugin cannot run without %s php module installed. Please contact your host and ask them to install %s.', 'wpdesk-plugin' ), esc_html( $this->plugin_name ), esc_html( basename( $nice_module_name ) ), esc_html( basename( $nice_module_name ) ) ) );
}
}
}
return $notices;
}
/**
* @param array $notices
*
* @return array
*/
private function append_settings_require_notices( $notices ) {
if ( count( $this->setting_require ) > 0 ) {
foreach ( $this->setting_require as $setting => $value ) {
if ( ! $this->is_setting_set( $setting, $value ) ) {
$notices[] = $this->prepare_notice_message( sprintf( __( 'The &#8220;%s&#8221; plugin cannot run without %s php setting set to %s. Please contact your host and ask them to set %s.', 'wpdesk-plugin' ), esc_html( $this->plugin_name ), esc_html( basename( $setting ) ), esc_html( basename( $value ) ), esc_html( basename( $setting ) ) ) );
}
}
}
return $notices;
}
/**
* @param array $notices
*
* @return array
*/
private function append_plugin_require_notices( $notices ) {
if ( count( $this->plugin_require ) > 0 ) {
foreach ( $this->plugin_require as $plugin_name => $nice_plugin_name ) {
if ( ! $this->is_wp_plugin_active( $plugin_name ) ) {
$notices[] = $this->prepare_notice_message( sprintf( __( 'The &#8220;%s&#8221; plugin cannot run without %s active. Please install and activate %s plugin.', 'wpdesk-plugin' ), esc_html( $this->plugin_name ), esc_html( basename( $nice_plugin_name ) ), esc_html( basename( $nice_plugin_name ) ) ) );
}
}
}
return $notices;
}
/**
* @param string $name
* @param mixed $value
*
* @return bool
*/
public static function is_setting_set( $name, $value ) {
return ini_get( $name ) === strval( $value );
}
/**
* @param string $name
*
* @return bool
*/
public static function is_module_active( $name ) {
return extension_loaded( $name );
}
/**
* @return void
*/
public function disable_plugin_render_notice() {
add_action( 'admin_notices', array( $this, 'deactivate_action' ) );
add_action( 'admin_notices', array( $this, 'render_notices_action' ) );
}
/**
* Shoud be called as WordPress action
*
* @return void
*/
public function render_notices_action() {
foreach ( $this->notices as $notice ) {
echo $notice;
}
}
/**
* Prepares message in html format
*
* @param string $message
*
* @return string
*/
private function prepare_notice_message( $message ) {
return '<div class="error"><p>' . $message . '</p></div>';
}
/**
* @return void
*/
public function deactivate_action() {
if ( isset( $this->plugin_file ) ) {
deactivate_plugins( plugin_basename( $this->plugin_file ) );
}
}
/**
* @param $min_version
*
* @return mixed
*/
public static function is_php_at_least( $min_version ) {
return version_compare( phpversion(), $min_version, '>=' );
}
/**
* @param string $min_version
*
* @return bool
*/
public static function is_wp_at_least( $min_version ) {
return version_compare( get_bloginfo( 'version' ), $min_version, '>=' );
}
/**
* Checks if plugin is active. Needs to be enabled in deferred way.
*
* @param string $plugin_file
*
* @return bool
*/
public static function is_wp_plugin_active( $plugin_file ) {
$active_plugins = (array) get_option( 'active_plugins', array() );
if ( is_multisite() ) {
$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
}
return in_array( $plugin_file, $active_plugins ) || array_key_exists( $plugin_file, $active_plugins );
}
/**
* Checks if plugin is active and have designated version. Needs to be enabled in deferred way.
*
* @param string $min_version
*
* @return bool
*/
public static function is_wc_at_least( $min_version ) {
return defined('WC_VERSION') &&
version_compare( WC_VERSION, $min_version, '>=' );
}
}
}
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
if ( ! class_exists( 'WPDesk_Settings_1_10' ) ) {
if ( ! class_exists( 'WPDesk_S214_Settings_1_10' ) ) {
require_once 'settings-api/class.s214-settings.php';
}
/**
* Base plugin class for WP Desk plugins settings
*
* @author Grzegorz
*
*/
class WPDesk_Settings_1_10 extends WPDesk_S214_Settings_1_10 {
private $slug;
protected $version = '1.0';
protected $plugin_text_domain = 'wpdesk-plugin';
protected $plugin = null;
protected $func = 'wpdesk_plugin';
public function __construct( WPDesk_Plugin_1_10 $plugin, $slug = 'wpdesk-settings', $default_tab = 'general' ) {
parent::__construct( $slug, $default_tab );
$this->slug = $slug;
$this->plugin = $plugin;
$this->func = str_replace( '-', '_', $slug );
global ${$this->func . '_options'};
${$this->func . '_options'} = $this->get_settings();
$this->hooks();
}
public function hooks() {
}
public function render_settings_page() {
parent::render_settings_page();
}
public function enqueue_scripts( $hook ) {
if ( ! apply_filters( $this->func . '_load_admin_scripts', $this->load_scripts( $hook ), $hook ) ) {
return;
}
global $wp_scripts;
// Use minified libraries if SCRIPT_DEBUG is turned off
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
//$url_path = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, dirname( __FILE__ ) );
$url_path = $this->plugin->get_plugin_url() . 'classes/wpdesk';
$select2_cdn = 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/';
$cm_cdn = 'https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.14.2/';
$jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.11.4';
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'wp-color-picker' );
wp_enqueue_script( 'jquery-ui-tooltip' );
wp_enqueue_media();
wp_enqueue_style( 'jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui' . $suffix . '.css', array(), $jquery_version );
wp_enqueue_script( 'media-upload' );
wp_enqueue_style( 'thickbox' );
wp_enqueue_script( 'thickbox' );
wp_enqueue_style( 's14-select2', $select2_cdn . 'css/select2' . $suffix . '.css', array(), '4.0.3' );
wp_enqueue_script( 's14-select2', $select2_cdn . 'js/select2' . $suffix . '.js', array( 'jquery' ), '4.0.3' );
wp_enqueue_style( $this->slug . '-cm', $cm_cdn . 'codemirror.css', array(), '5.10' );
wp_enqueue_script( $this->slug . '-cm', $cm_cdn . 'codemirror.js', array( 'jquery' ), '5.14.2' );
wp_enqueue_script( $this->slug . '-cm-html', $cm_cdn . 'mode/htmlmixed/htmlmixed.js', array(
'jquery',
$this->slug . '-cm'
), '5.14.2' );
wp_enqueue_script( $this->slug . '-cm-xml', $cm_cdn . 'mode/xml/xml.js', array(
'jquery',
$this->slug . '-cm'
), '5.14.2' );
wp_enqueue_script( $this->slug . '-cm-js', $cm_cdn . 'mode/javascript/javascript.js', array(
'jquery',
$this->slug . '-cm'
), '5.14.2' );
wp_enqueue_script( $this->slug . '-cm-css', $cm_cdn . 'mode/css/css.js', array(
'jquery',
$this->slug . '-cm'
), '5.14.2' );
wp_enqueue_script( $this->slug . '-cm-php', $cm_cdn . 'mode/php/php.js', array(
'jquery',
$this->slug . '-cm'
), '5.14.2' );
wp_enqueue_script( $this->slug . '-cm-clike', $cm_cdn . 'mode/clike/clike.js', array(
'jquery',
$this->slug . '-cm'
), '5.14.2' );
wp_enqueue_style( $this->slug, $url_path . '/assets/css/admin-settings' . $suffix . '.css', array(), $this->version );
wp_enqueue_script( $this->slug . '-js', $url_path . '/assets/js/admin-settings' . $suffix . '.js', array( 'jquery' ), $this->version );
wp_localize_script( $this->slug . '-js', 's214_settings_vars', apply_filters( $this->func . 'localize_script', array(
'func' => $this->func,
'image_media_button' => __( 'Insert Image', 'wpdesk-plugin' ),
'image_media_title' => __( 'Select Image', 'wpdesk-plugin' ),
) ) );
}
/**
* Add settings sections and fields
*
* @access public
* @since 1.0.0
* @return void
*/
function register_settings() {
if ( get_option( $this->func . '_settings' ) == false ) {
add_option( $this->func . '_settings' );
}
foreach ( $this->get_registered_settings() as $tab => $sections ) {
foreach ( $sections as $section => $settings ) {
// Check for backwards compatibility
$section_tabs = $this->get_settings_tab_sections( $tab );
if ( ! is_array( $section_tabs ) || ! array_key_exists( $section, $section_tabs ) ) {
$section = 'main';
$settings = $sections;
}
add_settings_section(
$this->func . '_settings_' . $tab . '_' . $section,
__return_null(),
'__return_false',
$this->func . '_settings_' . $tab . '_' . $section
);
foreach ( $settings as $option ) {
// For backwards compatibility
if ( empty( $option['id'] ) ) {
continue;
}
$name = isset( $option['name'] ) ? $option['name'] : '';
add_settings_field(
$this->func . '_settings[' . $option['id'] . ']',
$name,
function_exists( $this->func . '_' . $option['type'] . '_callback' ) ? $this->func . '_' . $option['type'] . '_callback' : ( method_exists( $this, $option['type'] . '_callback' ) ? array(
$this,
$option['type'] . '_callback'
) : array( $this, 'missing_callback' ) ),
$this->func . '_settings_' . $tab . '_' . $section,
$this->func . '_settings_' . $tab . '_' . $section,
array(
'section' => $section,
'id' => isset( $option['id'] ) ? $option['id'] : null,
'desc' => ! empty( $option['desc'] ) ? $option['desc'] : '',
'name' => isset( $option['name'] ) ? $option['name'] : null,
'size' => isset( $option['size'] ) ? $option['size'] : null,
'options' => isset( $option['options'] ) ? $option['options'] : '',
'std' => isset( $option['std'] ) ? $option['std'] : '',
'min' => isset( $option['min'] ) ? $option['min'] : null,
'max' => isset( $option['max'] ) ? $option['max'] : null,
'step' => isset( $option['step'] ) ? $option['step'] : null,
'select2' => isset( $option['select2'] ) ? $option['select2'] : null,
'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : null,
'multiple' => isset( $option['multiple'] ) ? $option['multiple'] : null,
'allow_blank' => isset( $option['allow_blank'] ) ? $option['allow_blank'] : true,
'readonly' => isset( $option['readonly'] ) ? $option['readonly'] : false,
'buttons' => isset( $option['buttons'] ) ? $option['buttons'] : null,
'wpautop' => isset( $option['wpautop'] ) ? $option['wpautop'] : null,
'teeny' => isset( $option['teeny'] ) ? $option['teeny'] : null,
'tab' => isset( $option['tab'] ) ? $option['tab'] : null,
'tooltip_title' => isset( $option['tooltip_title'] ) ? $option['tooltip_title'] : false,
'tooltip_desc' => isset( $option['tooltip_desc'] ) ? $option['tooltip_desc'] : false,
'available_header' => isset( $option['available_header'] ) ? $option['available_header'] : null,
'selected_header' => isset( $option['selected_header'] ) ? $option['selected_header'] : null,
'class' => isset( $option['class'] ) ? $option['class'] : '',
)
);
}
}
}
register_setting( $this->func . '_settings', $this->func . '_settings', array(
$this,
'settings_sanitize'
) );
}
/**
* Checkbox callback
*
* @access public
* @since 1.0.0
*
* @param array $args Arguments passed by the setting
*
* @global array ${$this->func . '_options'} The plugin options
* @return void
*/
public function checkbox_callback( $args ) {
global ${$this->func . '_options'};
$name = ' name="' . $this->func . '_settings[' . $args['id'] . ']"';
if ( isset( ${$this->func . '_options'}[ $args['id'] ] ) ) {
$value = ${$this->func . '_options'}[ $args['id'] ];
} else {
$value = isset( $args['std'] ) ? $args['std'] : '';
}
$checked = checked( 1, $value, false );
$html = '<input type="hidden"' . $name . ' value="0" />';
$html .= '<input type="checkbox" id="' . $this->func . '_settings[' . $args['id'] . ']"' . $name . ' value="1" ' . $checked . '/>&nbsp;';
$html .= '<span class="description"><label for="' . $this->func . '_settings[' . $args['id'] . ']">' . $args['desc'] . '</label></span>';
echo apply_filters( $this->func . '_after_setting_output', $html, $args );
}
/**
* Date callback
*
* @access public
* @since 1.0.0
*
* @param array $args Arguments passed by the setting
*
* @global array ${$this->func . '_options'} The Beacon options
* @return void
*/
public function date_callback( $args ) {
global ${$this->func . '_options'};
if ( isset( ${$this->func . '_options'}[ $args['id'] ] ) ) {
$value = ${$this->func . '_options'}[ $args['id'] ];
} else {
$value = isset( $args['std'] ) ? $args['std'] : '';
}
$name = ' name="' . $this->func . '_settings[' . $args['id'] . ']"';
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'date';
$readonly = $args['readonly'] === true ? ' readonly="readonly"' : '';
$html = '<input type="date" ' . '" class="' . $size . '-text" id="' . $this->func . '_settings[' . $args['id'] . ']"' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '"' . $readonly . '/>&nbsp;';
$html .= '<span class="description"><label for="' . $this->func . '_settings[' . $args['id'] . ']">' . $args['desc'] . '</label></span>';
echo apply_filters( $this->func . '_after_setting_output', $html, $args );
}
/**
* select 2 columns
*
* @access public
* @since 1.0.0
*
* @param array $args Arguments passed by the setting
*
* @global array ${$this->func . '_options'} The Beacon options
* @return void
*/
public function select_2_columns_callback( $args ) {
global ${$this->func . '_options'};
if ( isset( ${$this->func . '_options'}[ $args['id'] ] ) ) {
$value = ${$this->func . '_options'}[ $args['id'] ];
} else {
$value = isset( $args['std'] ) ? $args['std'] : '';
}
$value_array = explode( ',', $value );
$available_header = isset( $args['available_header'] ) ? $args['available_header'] : '';
$selected_header = isset( $args['selected_header'] ) ? $args['selected_header'] : '';
$html = '<input type="hidden" value="' . esc_attr( $value ) . '" id="' . $this->func . '_settings[' . $args['id'] . ']" name="' . $this->func . '_settings[' . $args['id'] . ']"' . ' />';
$html_list_available = '<div class="available-column">';
$html_list_available .= '<strong>' . $available_header . '</strong>';
$html_list_available .= '<ul id="' . $this->func . '_settings[' . $args['id'] . '][available]" class="available connectedSortable">';
$html_list_selected = '<div class="selected-column">';
$html_list_selected .= '<strong>' . $selected_header . '</strong>';
$html_list_selected .= '<ul id="' . $this->func . '_settings[' . $args['id'] . '][selected]" class="selected connectedSortable">';
foreach ( $args['options'] as $option => $name ) {
if ( is_array( $value_array ) && in_array( $option, $value_array ) ) {
$html_list_selected .= '<li data-value="' . esc_attr( $option ) . '">' . $name . '</li>';
} else {
$html_list_available .= '<li data-value="' . esc_attr( $option ) . '">' . $name . '</li>';
}
}
$html_list_available .= '</ul></div>';
$html_list_selected .= '</ul></div>';
$html .= '<div class="select-2-columns">';
$html .= $html_list_available;
$html .= $html_list_selected;
$html .= '<div style="clear:both;">';
$html .= '<script type="text/javascript">';
$html .= "\n";
$html .= '
jQuery( function() {
jQuery( "#' . $this->func . '_settings\\\\[' . $args['id'] . '\\\\]\\\\[available\\\\], #' . $this->func . '_settings\\\\[' . $args['id'] . '\\\\]\\\\[selected\\\\]" ).sortable({
connectWith: ".connectedSortable",
deactivate: function( event, ui ) {
jQuery("#' . $this->func . '_settings\\\\[' . $args['id'] . '\\\\]").val("");
var val = "";
jQuery("#' . $this->func . '_settings\\\\[' . $args['id'] . '\\\\]\\\\[selected\\\\] > li").each( function () {
if ( val != "" ) {
val = val + ",";
}
val = val + jQuery(this).attr("data-value");
});
jQuery("#' . $this->func . '_settings\\\\[' . $args['id'] . '\\\\]").val(val);
}
}).disableSelection();
} );
';
$html .= "\n";
$html .= '</script>';
$html .= '</div>';
$html .= '<span class="description"><label for="' . $this->func . '_settings[' . $args['id'] . ']">' . $args['desc'] . '</label></span>';
echo apply_filters( $this->func . '_after_setting_output', $html, $args );
}
public function set_text_domain( $plugin_text_domain ) {
$this->plugin_text_domain = $plugin_text_domain;
}
public function get_text_domain() {
return $this->plugin_text_domain;
}
}
}
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
if ( ! function_exists( 'wpdesk_is_plugin_active' ) ) {
/**
* @param $plugin_file
*
* @return bool
* @deprecated 1.10 Use requirement class
*/
function wpdesk_is_plugin_active( $plugin_file ) {
return WPDesk_Requirement_Checker_1_10::is_wp_plugin_active($plugin_file);
}
}
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
if ( !interface_exists( 'WPDesk_Plugin_Factory_1_10' ) ) {
interface WPDesk_Plugin_Factory_1_10 {
const WPDESK_FILTER_PLUGIN_CLASS = 'wpdesk_plugin_class';
static function build_plugin();
static function get_plugin_instance();
}
}
\ No newline at end of file
File deleted
msgid ""
msgstr ""
"Project-Id-Version: WP Desk Class\n"
"POT-Creation-Date: 2016-10-27 14:04+0100\n"
"PO-Revision-Date: 2016-10-27 14:05+0100\n"
"Last-Translator: wp-kat <admin@wp-kat.net>\n"
"Language-Team: \n"
"Language: pl_PL\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.7\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"X-Poedit-SearchPathExcluded-0: settings-api\n"
"X-Poedit-SearchPath-0: .\n"
#: class-helper.php:34
#, php-format
msgid ""
"The %s%s%s License Key has not been activated, so the plugin is inactive! "
"%sClick here%s to activate the license key and the plugin."
msgstr ""
"Klucz licencyjny wtyczki %s%s%s nie został aktywowany, więc wtyczka jest "
"nieaktywna! %sKliknij tutaj%s, aby aktywować klucz licencyjny wtyczki."
#: class-plugin.php:217
msgid "Docs"
msgstr "Docs"
#: class-plugin.php:218
msgid "Support"
msgstr "Wsparcie"
#: class-plugin.php:224
msgid "Settings"
msgstr "Ustawienia"
#: class-plugin.php:270
#, php-format
msgid ""
"<a href=\"%s\">Install the WP Desk Helper plugin</a> to activate and get "
"updates for your WP Desk plugins."
msgstr ""
"<a href=\"%s\">Zainstaluj wtyczkę WP Desk Helper</a>, aby aktywować i "
"otrzymywać aktualizacje wtyczek WP Desk."
#: class-plugin.php:276
#, php-format
msgid ""
"<a href=\"%s\">Activate the WP Desk Helper plugin</a> to activate and get "
"updates for your WP Desk plugins."
msgstr ""
"<a href=\"%s\">Włącz wtyczkę WP Desk Helper</a>, aby aktywować i otrzymywać "
"aktualizacje wtyczek WP Desk."
#: class-settings.php:85 settings-api/class.s214-settings.php:1211
msgid "Insert Image"
msgstr "Wstaw obrazek"
#: class-settings.php:86 settings-api/class.s214-settings.php:1212
msgid "Select Image"
msgstr "Wybierz obrazek"
#: settings-api/class.s214-settings.php:144
#: settings-api/class.s214-settings.php:146
msgid "Section214 Settings"
msgstr "Ustawienia Section214"
#: settings-api/class.s214-settings.php:592
msgid "Settings updated."
msgstr "Ustawienia zostały zaktualizowane."
#: settings-api/class.s214-settings.php:977
msgid ""
"To copy the system info, click below then press Ctrl + C (PC) or Cmd + C "
"(Mac)."
msgstr ""
"Aby skopiować informacje systemowe kliknij poniżej a następnie wciśnij Ctrl"
"+C lub Cmd+C."
#: settings-api/class.s214-settings.php:980
msgid "Download System Info File"
msgstr "Pobierz plik z informacjami systemowymi"
#: settings-api/class.s214-settings.php:1060
msgid "Upload File"
msgstr "Załaduj plik"
#: settings-api/class.s214-settings.php:1090
msgid "Deactivate License"
msgstr "Deaktywacja licencji"
#: settings-api/class.s214-settings.php:1121
#, php-format
msgid ""
"The callback function used for the <strong>%s</strong> setting is missing."
msgstr "Funkcja callback dla <strong>%s</strong> nie istnieje"
#~ msgid "Licensing"
#~ msgstr "Licencjonowanie"
#~ msgid "%1$s License Key"
#~ msgstr "Klucz licencji %1$s"
#~ msgid ""
#~ "Please enter your license key to enable automatic updates and support."
#~ msgstr ""
#~ "Wprowadz klucz licencji aby aktywować automatyczne aktualizacje i support."
#~ msgid "Nonce verification failed"
#~ msgstr "Błąd weryfikacji nonce"
#~ msgid "Error"
#~ msgstr "Błąd"
#~ msgid "This license does not belong to the product you have entered it for."
#~ msgstr "Licencja dotyczy innego produktu."
#~ msgid "This license does not have any activations left"
#~ msgstr "Licencja nie posiada wolnych aktywacji."
#~ msgid "This license key is expired. Please renew it."
#~ msgstr "Klucz licencyjny wygasł. Proszę go odnowić."
#~ msgid ""
#~ "There was a problem activating your license key, please try again or "
#~ "contact support. Error code: %s"
#~ msgstr ""
#~ "Wystąpił problem przy aktywacji klucza licencji, proszę spróbować "
#~ "ponownie lub skontaktować się z supportem. Kod błędu: %s"
#~ msgid ""
#~ "There is a new version of %1$s available. %2$sView version %3$s details"
#~ "%4$s."
#~ msgstr ""
#~ "Jest dostępna nowa wersja %1$s . %2$sZobacz szczegóły %3$s wersji %4$s."
#~ msgid "You do not have permission to install plugin updates"
#~ msgstr "Brak uprawnień do instalacji aktualizacji"
/* Fix color picker label alignment
-------------------------------------------------------------- */
.s214-color-picker-label {
position: absolute;
display: inline-block;
padding-top: 4px;
}
/* System info styles
-------------------------------------------------------------- */
#system-info-textarea {
width: 800px;
height: 400px;
font-family: Menlo, Monaco, monospace;
background: none;
white-space: pre;
overflow: auto;
display: block;
}
/* Tooltips
-------------------------------------------------------------- */
.s214-help-tip {
cursor: help;
}
.ui-tooltip {
background: #333 !important;
border-radius: 3px !important;
box-shadow: 1px 1px 2px 1px rgba(214,214,214,0.5);
color: #dedede !important;
max-width: 300px;
padding: 7px;
text-rendering: optimizeLegibility;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment