Skip to content
Permalink
Browse files

Tweaks

  • Loading branch information...
Evan Herman
Evan Herman committed May 15, 2019
1 parent bcded99 commit 171357b6b6b136e237f7d08589ff8b4e46179a59
@@ -29,14 +29,14 @@ jobs:
- run:
name: "Install Dependencies"
command: |
bash .dev/install-dependencies.sh
bash .dev/bin/install-dependencies.sh
- run:
name: "Run PHPCS"
command: phpcs --standard=phpcs.xml --extensions=php --colors -s -p -v .
- run:
name: "Run PHPUnit - Single Site - Generate Coverage Reports"
command: |
bash .dev/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest
bash .dev/bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest
phpunit --coverage-html=/tmp/artifacts/code-coverage/html --coverage-clover=/tmp/artifacts/code-coverage/clover
- store_artifacts:
path: /tmp/artifacts/code-coverage/html
@@ -57,14 +57,14 @@ jobs:
source /home/circleci/.bashrc
- run:
name: "Install Dependencies"
command: bash .dev/install-dependencies.sh
command: bash .dev/bin/install-dependencies.sh
- run:
name: "Run PHPCS"
command: phpcs --standard=phpcs.xml --extensions=php --colors -s -p -v .
- run:
name: "Run PHPUnit - Single Site"
command: |
bash .dev/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest
bash .dev/bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest
phpunit
- run:
name: "Run PHPUnit - Multisite"
@@ -118,7 +118,7 @@ jobs:
- run:
name: "Setup apache conf"
command: |
sudo cp .dev/tests/apache-ci.conf /etc/apache2/sites-available/apache-ci.conf
sudo cp .dev/bin/tests/apache-ci.conf /etc/apache2/sites-available/apache-ci.conf
sudo a2ensite apache-ci
sudo a2enmod rewrite
sudo service apache2 start
@@ -127,15 +127,15 @@ jobs:
command: echo '127.0.0.1 acceptance.localhost' | sudo tee -a /etc/hosts
- run:
name: "Install Acceptance Test Dependencies"
command: bash .dev/install-acceptance-tests.sh
command: bash .dev/bin/install-acceptance-tests.sh
- run:
name: "Import Demo Site Database"
command: |
php /tmp/wp-cli.phar db reset --yes --path=/tmp/wordpress_acceptance
php /tmp/wp-cli.phar db import .dev/files/demo-site/demo-site.db --skip-optimization --path=/tmp/wordpress_acceptance
php /tmp/wp-cli.phar db import .dev/bin/files/demo-site/demo-site.db --skip-optimization --path=/tmp/wordpress_acceptance
php /tmp/wp-cli.phar theme install stackable --activate --force --path=/tmp/wordpress_acceptance
cp .dev/files/demo-site/.htaccess /tmp/wordpress_acceptance
mkdir /tmp/wordpress_acceptance/wp-content/mu-plugins && cp .dev/files/demo-site/overrides.php /tmp/wordpress_acceptance/wp-content/mu-plugins
cp .dev/bin/files/demo-site/.htaccess /tmp/wordpress_acceptance
mkdir /tmp/wordpress_acceptance/wp-content/mu-plugins && cp .dev/bin/files/demo-site/overrides.php /tmp/wordpress_acceptance/wp-content/mu-plugins
# - run:
# name: "Start Selenium"
# command: selenium-server-standalone
@@ -146,18 +146,18 @@ jobs:
# background: true
# - run:
# name: "Run Acceptance Tests"
# command: bash .dev/run-acceptance-tests.sh
# command: bash .dev/bin/run-acceptance-tests.sh
# - run:
# name: "Setup screenshots"
# when: always
# command: bash .dev/setup-screenshot-directories.sh
# command: bash .dev/bin/setup-screenshot-directories.sh
# - run:
# name: "Deploy screenshots"
# command: |
# if [ "${CIRCLE_BRANCH}" == "master" ]; then
# ./.dev/deploy-screenshots.sh live
# ./.dev/bin/deploy-screenshots.sh live
# else
# ./.dev/deploy-screenshots.sh --dry-run
# ./.dev/bin/deploy-screenshots.sh --dry-run
# fi
# - store_artifacts:
# path: /tmp/artifacts
@@ -195,9 +195,9 @@ jobs:
name: Deploy the plugin
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
./.dev/deploy.sh live
./.dev/bin/deploy.sh live
else
./.dev/deploy.sh --dry-run
./.dev/bin/deploy.sh --dry-run
fi
- store_artifacts:
path: /tmp/artifacts
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,18 @@
<?php
$_tests_dir = getenv( 'WP_TESTS_DIR' );
if ( ! $_tests_dir ) {
$_tests_dir = '/tmp/wordpress-tests-lib';
}
require_once $_tests_dir . '/includes/functions.php';
require_once dirname( __FILE__ ) . '/helpers.php';
function _manually_load_plugin() {
require dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/class-coblocks.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
require $_tests_dir . '/includes/bootstrap.php';
@@ -0,0 +1,44 @@
<?php
/**
* Test WPIcons Pro base plugin file
*
* @package WPIcons Pro Pro
* @since 2.0.0
*/
class Base_File_Tests extends WP_UnitTestCase {
/**
* Plugin instance
*
* @var object
*/
private $coblocks;
public function setUp() {
parent::setUp();
$this->coblocks = coblocks();
do_action( 'plugins_loaded' );
}
public function tearDown() {
parent::tearDown();
}
/**
* Assert the plugin data returns what is expected
*
* @since 2.0.0
*/
public function test_start() {
$this->assertTrue( true );
}
}
@@ -99,7 +99,9 @@ public function content() {
<?php
echo sprintf(
/* translators: 1: Opening <strong> tag, 2: Closing </strong> tag */
esc_html__( 'You\'ve just added lots of useful blocks and a new page builder toolkit to the WordPress editor. CoBlocks gives you a game-changing set of features: %1$s tens of blocks %2$s, a %1$s page-builder experience %2$s, %1$s typography controls %2$s and a new %1$s Block Manager %2$s for turning off blocks.', 'coblocks' ), '<strong>', '</strong>'
esc_html__( 'You\'ve just added lots of useful blocks and a new page builder toolkit to the WordPress editor. CoBlocks gives you a game-changing set of features: %1$s tens of blocks %2$s, a %1$s page-builder experience %2$s, %1$s typography controls %2$s and a new %1$s Block Manager %2$s for turning off blocks.', 'coblocks' ),
'<strong>',
'</strong>'
);
?>
</p>
@@ -123,7 +125,9 @@ public function content() {
<?php
echo sprintf(
/* translators: 1: Opening <a> tag to the CoBlocks YouTube channel, 2: Closing </a> tag */
esc_attr__( 'Like what you see? %1$sSubscribe to our YouTube channel%2$s and we\'ll let you know when new video tutorials are released.', 'coblocks' ), '<a href="https://www.youtube.com/channel/UCsOcD4k5eUBH_wWhcxPJZcA" target="_blank">', '</a>'
esc_attr__( 'Like what you see? %1$sSubscribe to our YouTube channel%2$s and we\'ll let you know when new video tutorials are released.', 'coblocks' ),
'<a href="https://www.youtube.com/channel/UCsOcD4k5eUBH_wWhcxPJZcA" target="_blank">',
'</a>'
);
?>
</p>
@@ -132,7 +136,11 @@ public function content() {
<?php
echo sprintf(
/* translators: 1: Opening <a> tag to the CoBlocks Twitter account, 2: Opening <a> tag to the CoBlocks Facebook group, 3: Opening <a> tag to the CoBlocks newsletter, 4: Closing </a> tag */
esc_html__( 'If you have any questions or feedback, let us know on %1$sTwitter%4$s or our %2$sFacebook group %4$s. Also, %3$ssubscribe to our newsletter%4$s if you want to stay up to date with what\'s new and upcoming at CoBlocks.', 'coblocks' ), '<a href="https://twitter.com/coblocks" target="_blank">', '<a href="https://www.facebook.com/groups/coblocks" target="_blank">', '<a href="https://coblocks.us20.list-manage.com/subscribe?u=fd78cec472f9f62b76fca64d1&id=62cbc3526f" target="_blank">', '</a>'
esc_html__( 'If you have any questions or feedback, let us know on %1$sTwitter%4$s or our %2$sFacebook group %4$s. Also, %3$ssubscribe to our newsletter%4$s if you want to stay up to date with what\'s new and upcoming at CoBlocks.', 'coblocks' ),
'<a href="https://twitter.com/coblocks" target="_blank">',
'<a href="https://www.facebook.com/groups/coblocks" target="_blank">',
'<a href="https://coblocks.us20.list-manage.com/subscribe?u=fd78cec472f9f62b76fca64d1&id=62cbc3526f" target="_blank">',
'</a>'
);
?>
</p>
@@ -135,42 +135,42 @@ public function styles() {
$responsive_height = json_decode( $responsive_height );
if ( $responsive_height && ! is_admin() ) {
foreach ( $responsive_height as $dividerKey => $dividerObj ) {
if ( ! empty( $dividerObj ) ) {
foreach ( $dividerObj as $dividerElement => $dividerElObj ) {
foreach ( $responsive_height as $divider_key => $divider_obj ) {
if ( ! empty( $divider_obj ) ) {
foreach ( $divider_obj as $divider_element => $divider_el_obj ) {
$output .= '@media only screen and (max-width: ' . apply_filters( 'coblocks_tablet_breakpoint', '768px' ) . ') {';
if ( $dividerElement == 'height' && isset( $dividerElObj->heightTablet ) ) {
$output .= sprintf( '.%1$s > [class*="__inner"]:not(.is-fullscreen) {', esc_attr( $dividerKey ) );
$output .= 'min-height:' . $dividerElObj->heightTablet . 'px !important';
if ( 'height' === $divider_element && isset( $divider_el_obj->heightTablet ) ) { // @codingStandardsIgnoreLine
$output .= sprintf( '.%1$s > [class*="__inner"]:not(.is-fullscreen) {', esc_attr( $divider_key ) );
$output .= 'min-height:' . $divider_el_obj->heightTablet . 'px !important'; // @codingStandardsIgnoreLine
$output .= '}';
}
if ( $dividerElement == 'shapeHeight' && isset( $dividerElObj->heightTablet ) ) {
$output .= sprintf( '.%1$s > .wp-block-coblocks-shape-divider__svg-wrapper {', esc_attr( $dividerKey ) );
$output .= 'min-height:' . $dividerElObj->heightTablet . 'px !important';
if ( 'shapeHeight' === $divider_element && isset( $divider_el_obj->heightTablet ) ) { // @codingStandardsIgnoreLine
$output .= sprintf( '.%1$s > .wp-block-coblocks-shape-divider__svg-wrapper {', esc_attr( $divider_key ) );
$output .= 'min-height:' . $divider_el_obj->heightTablet . 'px !important'; // @codingStandardsIgnoreLine
$output .= '}';
}
if ( $dividerElement == 'backgroundHeight' && isset( $dividerElObj->heightTablet ) ) {
$output .= sprintf( '.%1$s > .wp-block-coblocks-shape-divider__alt-wrapper {', esc_attr( $dividerKey ) );
$output .= 'min-height:' . $dividerElObj->heightTablet . 'px !important';
if ( 'backgroundHeight' === $divider_element && isset( $divider_el_obj->heightTablet ) ) { // @codingStandardsIgnoreLine
$output .= sprintf( '.%1$s > .wp-block-coblocks-shape-divider__alt-wrapper {', esc_attr( $divider_key ) );
$output .= 'min-height:' . $divider_el_obj->heightTablet . 'px !important'; // @codingStandardsIgnoreLine
$output .= '}';
}
$output .= '}';
$output .= '@media only screen and (max-width: ' . apply_filters( 'coblocks_desktop_breakpoint', '514px' ) . ') {';
if ( $dividerElement == 'shapeHeight' && isset( $dividerElObj->heightMobile ) ) {
$output .= sprintf( '.%1$s > .wp-block-coblocks-shape-divider__svg-wrapper {', esc_attr( $dividerKey ) );
$output .= 'min-height:' . $dividerElObj->heightMobile . 'px !important';
if ( 'shapeHeight' === $divider_element && isset( $divider_el_obj->heightMobile ) ) { // @codingStandardsIgnoreLine
$output .= sprintf( '.%1$s > .wp-block-coblocks-shape-divider__svg-wrapper {', esc_attr( $divider_key ) );
$output .= 'min-height:' . $divider_el_obj->heightMobile . 'px !important'; // @codingStandardsIgnoreLine
$output .= '}';
}
if ( $dividerElement == 'backgroundHeight' && isset( $dividerElObj->heightMobile ) ) {
$output .= sprintf( '.%1$s > .wp-block-coblocks-shape-divider__alt-wrapper {', esc_attr( $dividerKey ) );
$output .= 'min-height:' . $dividerElObj->heightMobile . 'px !important';
if ( 'backgroundHeight' === $divider_element && isset( $divider_el_obj->heightMobile ) ) { // @codingStandardsIgnoreLine
$output .= sprintf( '.%1$s > .wp-block-coblocks-shape-divider__alt-wrapper {', esc_attr( $divider_key ) );
$output .= 'min-height:' . $divider_el_obj->heightMobile . 'px !important'; // @codingStandardsIgnoreLine
$output .= '}';
}
if ( $dividerElement == 'height' && isset( $dividerElObj->heightMobile ) ) {
$output .= sprintf( '.%1$s > [class*="__inner"]:not(.is-fullscreen) {', esc_attr( $dividerKey ) );
$output .= 'min-height:' . $dividerElObj->heightMobile . 'px !important';
if ( 'height' === $divider_element && isset( $divider_el_obj->heightMobile ) ) { // @codingStandardsIgnoreLine
$output .= sprintf( '.%1$s > [class*="__inner"]:not(.is-fullscreen) {', esc_attr( $divider_key ) );
$output .= 'min-height:' . $divider_el_obj->heightMobile . 'px !important'; // @codingStandardsIgnoreLine
$output .= '}';
}
$output .= '}';
@@ -29,7 +29,9 @@ public function __construct() {
*/
public function register_meta() {
register_meta(
'post', '_coblocks_attr', array(
'post',
'_coblocks_attr',
array(
'show_in_rest' => true,
'single' => true,
'auth_callback' => function() {
@@ -39,7 +41,9 @@ public function register_meta() {
);
register_meta(
'post', '_coblocks_dimensions', array(
'post',
'_coblocks_dimensions',
array(
'show_in_rest' => true,
'single' => true,
'auth_callback' => function() {
@@ -49,7 +53,9 @@ public function register_meta() {
);
register_meta(
'post', '_coblocks_responsive_height', array(
'post',
'_coblocks_responsive_height',
array(
'show_in_rest' => true,
'single' => true,
'auth_callback' => function() {
@@ -59,7 +65,9 @@ public function register_meta() {
);
register_meta(
'post', '_coblocks_accordion_ie_support', array(
'post',
'_coblocks_accordion_ie_support',
array(
'show_in_rest' => true,
'single' => true,
'auth_callback' => function() {
@@ -16,7 +16,6 @@
<directory>./</directory>
<exclude>
<directory suffix=".php">./build</directory>
<file>./lib/constants.php</file>
</exclude>
</whitelist>
</filter>
@@ -222,7 +222,8 @@ function coblocks_register_social_block() {
}
register_block_type(
'coblocks/social', array(
'coblocks/social',
array(
'editor_script' => 'coblocks-editor',
'editor_style' => 'coblocks-editor',
'style' => 'coblocks-frontend',
@@ -299,4 +300,3 @@ function coblocks_register_social_block() {
);
}
add_action( 'init', 'coblocks_register_social_block' );

0 comments on commit 171357b

Please sign in to comment.
You can’t perform that action at this time.