Skip to content

Commit

Permalink
Merge branch 'develop' into release/1.0.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	autotweet.php
#	readme.txt
  • Loading branch information
Adam Silverstein committed Oct 16, 2019
2 parents c75aa4a + dbb37bf commit 3bebac2
Show file tree
Hide file tree
Showing 40 changed files with 8,969 additions and 8,051 deletions.
10 changes: 9 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{
"presets": ["@babel/env", "@babel/preset-react"]
"presets": ["@babel/env", "@babel/preset-react"],
"plugins": [
[
"@wordpress/babel-plugin-makepot",
{
"output": "languages/autotweet.pot",
}
],
]
}
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
assets
dist
webpack.config.js
node_modules
vendor
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"globals": {
"adminAutotweet": "readonly",
"jQuery": "readonly",
"wp": "readonly"
},
"extends": "@10up/eslint-config"
"extends": "plugin:@wordpress/eslint-plugin/recommended"
}
44 changes: 44 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test

on:
pull_request:
branches:
- develop

jobs:
eslint:
name: eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install node v12
uses: actions/setup-node@v1
with:
node-version: 12
- name: npm install
run: npm install
- name: eslint
uses: icrawl/action-eslint@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
job-name: eslint

test_php:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3']

steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install dependencies
run: composer install
- name: Run PHPCS
if: matrix.php-versions == '7.3'
run: composer run lint
- name: Run PHPUnit
run: |
composer run setup-local-tests
composer test
57 changes: 0 additions & 57 deletions assets/css/admin-auto_tweet.css

This file was deleted.

104 changes: 104 additions & 0 deletions assets/css/admin-autotweet.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#autotweet_metabox p::before {
display: inline-block;
margin-left: -1px;
padding-right: 3px;
vertical-align: top;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

#autotweet_metabox pre {
font-size: 11px;
white-space: normal;
}

.autotweet-prepublish__checkbox .components-base-control__field, .autotweet-prepublish__checkbox-label {
display: flex;
align-items: center;
}

.autotweet-prepublish__checkbox .components-base-control__field {
margin-top: 0.5rem;
}

.autotweet-prepublish__checkbox-label svg {
margin-right: 0.5rem;
}

.autotweet-prepublish__message-label {
display: flex;
justify-content: space-between;
}

.autotweet-prepublish__checkbox-row input[type=checkbox].components-checkbox-control__input {
margin-right: 0.5rem;
}

.autotweet-prepublish__override-row {
padding: 0.5rem 0;
}

.autotweet-prepublish__override-row .components-button {
margin-bottom: 1rem;
}

.autotweet-post-status {
font-style: italic;
}

.autotweet-post-status svg {
transform: translate3d(0, 3px, 0);
margin-right: 5px;
}

#autotweet-icon.pending,
.autotweet-prepublish__checkbox-row .dashicons-twitter.pending {
animation: fadeIn 1s infinite alternate;
color: #00aced;
}

#autotweet-icon.enabled,
.autotweet-prepublish__checkbox-row .dashicons-twitter.enabled {
color: #00aced;
}

#autotweet-icon.disabled,
.autotweet-prepublish__checkbox-row .dashicons-twitter.disabled {
color: #72777c;
}

@keyframes fadeIn {
from {
opacity: 0;
color: #72777c;
}
}

a#autotweet-edit {
color: #0073aa;
text-decoration: underline;
transition-property: border, background, color;
transition-duration: .05s;
transition-timing-function: ease-in-out
}

#autotweet-override-body {
margin: 4px 0;
}

textarea#autotweet-text {
margin: 4px 0 0;
width: 100%
}
span#autotweet-counter-wrap {
background: rgba(0, 0, 0, 0.07);
font-family: Consolas, Monaco, monospace;
}

span.near-limit {
color: darkorange;
}

span.over-limit {
color: red;
}
18 changes: 9 additions & 9 deletions assets/js/admin-auto_tweet.js → assets/js/admin-autotweet.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/**
* Handles the 10up Auto Tweet JS.
* Handles the Autotweet JS.
*
* @todo soooo much dependency :facepalm:
*/
( function( $ ) {
'use strict';

var $tweetPost = $( '#tenup-auto-tweet-enable' ),
$icon = $( '#tenup-auto-tweet-icon' ),
$tweetText = $( '#tenup-auto-tweet-text' ),
$editLink = $( '#tenup-auto-tweet-edit' ),
$editBody = $( '#tenup-auto-tweet-override-body' ),
var $tweetPost = $( '#autotweet-enable' ),
$icon = $( '#autotweet-icon' ),
$tweetText = $( '#autotweet-text' ),
$editLink = $( '#autotweet-edit' ),
$editBody = $( '#autotweet-override-body' ),
$hideLink = $( '.cancel-tweet-text' ),
errorMessageContainer = document.getElementById( 'tenup-autotweet-error-message' ),
counterWrap = document.getElementById( 'tenup-auto-tweet-counter-wrap' ),
errorMessageContainer = document.getElementById( 'autotweet-error-message' ),
counterWrap = document.getElementById( 'autotweet-counter-wrap' ),
limit = 280;

// Add enabled class if checked
Expand All @@ -34,7 +34,7 @@
} );
$hideLink.on( 'click', function( e ) {
e.preventDefault();
$( '#tenup-auto-tweet-override-body' ).slideToggle();
$( '#autotweet-override-body' ).slideToggle();
$editLink.show();
} );

Expand Down
14 changes: 7 additions & 7 deletions tenup-auto-tweet.php → autotweet.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?php
/**
* Plugin Name: 10up Auto Tweet
* Description: Automatically tweets the post title or custom message and a link to the post.
* Version: 0.1.0
* Plugin Name: Autotweet
* Description: Automatically tweets the post title or custom message and a link to the post.
* Version: 1.0.0
* Requires at least: 4.7
* Requires PHP: 7.0
* Author: 10up
* Author URI: https://10up.com
* License: GPL-2.0-or-later
* License URI: https://spdx.org/licenses/GPL-2.0-or-later.html
*
* @package TenUp\Auto_Tweet
* @package TenUp\AutoTweet
*/

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}

define( 'TUAT', __FILE__ );
define( 'AUTOTWEET', __FILE__ );
define( 'TUAT_VERSION', '0.1.0' );
define( 'TUAT_URL', plugin_dir_url( __FILE__ ) );
define( 'TUAT_PATH', plugin_dir_path( __FILE__ ) );
Expand All @@ -31,11 +31,11 @@
}


// Include the main functionality
// Include the main functionality.
require_once plugin_dir_path( __FILE__ ) . 'includes/core.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/utils.php';

/**
* Play nice with others.
*/
do_action( 'tenup_auto_tweet_loaded' );
do_action( 'tenup_autotweet_loaded' );
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
},
"require-dev": {
"phpunit/phpunit": "^7",
"10up/phpcs-composer": "dev-master"
"wp-coding-standards/wpcs": "^2.1",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0"
},
"scripts": {
"test": "phpunit",
"setup-local-tests": "bash bin/install-wp-tests.sh wordpress_test root password mysql latest",
"lint": "./vendor/bin/phpcs --extensions=php --severity=3 -s .",
"lint-fix": "./vendor/bin/phpcbf ."
"setup-local-tests": "bash bin/install-wp-tests.sh wordpress_test root root localhost latest",
"lint": "./vendor/bin/phpcs --extensions=php -s .",
"lint-fix": "./vendor/bin/phpcbf --extensions=php ."
}
}
Loading

0 comments on commit 3bebac2

Please sign in to comment.