├── .changeset └── config.json ├── .github └── workflows │ ├── phpcs.yml │ ├── phpunit.yml │ └── release.yml ├── .gitignore ├── README.md ├── babel.config.js ├── bin └── install-wp-tests.sh ├── composer.json ├── composer.lock ├── package-lock.json ├── package.json ├── phpcs.xml ├── phpunit.xml.dist ├── plugins ├── frontity-headtags │ ├── CHANGELOG.md │ ├── admin │ │ ├── components │ │ │ ├── button.js │ │ │ ├── card-link.js │ │ │ ├── card.js │ │ │ ├── footer.js │ │ │ ├── frontity-logo.js │ │ │ ├── global-styles.js │ │ │ ├── header.js │ │ │ ├── icons │ │ │ │ ├── arrow.js │ │ │ │ ├── check.js │ │ │ │ ├── close.js │ │ │ │ ├── frontity.js │ │ │ │ ├── github.js │ │ │ │ ├── heart.js │ │ │ │ ├── info.js │ │ │ │ ├── triangle.js │ │ │ │ └── twitter.js │ │ │ ├── index.js │ │ │ ├── link.js │ │ │ ├── main.js │ │ │ ├── modal-purge-cache.js │ │ │ ├── settings.js │ │ │ ├── tiny-card.js │ │ │ └── toggle.js │ │ ├── config.js │ │ └── index.js │ ├── assets │ │ ├── banner-1544x500.png │ │ ├── banner-772x250.png │ │ ├── icon-128x128.png │ │ ├── icon-256x256.png │ │ ├── screenshot-1.png │ │ └── screenshot-2.png │ ├── class-frontity-headtags-plugin.php │ ├── includes │ │ ├── class-frontity-headtags.php │ │ ├── filters │ │ │ └── class-frontity-headtags-filters.php │ │ ├── hooks │ │ │ ├── class-frontity-headtags-author-hooks.php │ │ │ ├── class-frontity-headtags-post-type-hooks.php │ │ │ └── class-frontity-headtags-taxonomy-hooks.php │ │ └── integrations │ │ │ ├── class-frontity-headtags-aioseo-3.php │ │ │ ├── class-frontity-headtags-aioseo-4.php │ │ │ └── class-frontity-headtags-yoast.php │ ├── package.json │ ├── plugin.php │ └── readme.txt ├── frontity-main-plugin │ ├── admin │ │ ├── components │ │ │ └── index.js │ │ ├── config.js │ │ └── index.js │ ├── class-frontity-main-plugin.php │ ├── package.json │ ├── plugin.php │ ├── require-dev.php │ └── require-prod.php ├── frontity-plugin-one │ ├── admin │ │ ├── components │ │ │ └── index.js │ │ ├── config.js │ │ └── index.js │ ├── class-frontity-plugin-one.php │ ├── package.json │ └── plugin.php └── frontity-plugin-two │ ├── admin │ ├── components │ │ └── index.js │ └── index.js │ ├── class-frontity-plugin-two.php │ ├── package.json │ └── plugin.php ├── scripts ├── build.js ├── release.js ├── symlink.js └── version.js ├── shared └── class-frontity-plugin.php ├── tests ├── bootstrap.php └── frontity-headtags │ └── test-headtags.php └── webpack.config.js /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@0.3.0/schema.json", 3 | "changelog": [ 4 | "@changesets/changelog-github", 5 | { "repo": "frontity/wp-plugins" } 6 | ], 7 | "commit": false, 8 | "linked": [], 9 | "access": "public", 10 | "baseBranch": "dev" 11 | } 12 | -------------------------------------------------------------------------------- /.github/workflows/phpcs.yml: -------------------------------------------------------------------------------- 1 | name: phpcs 2 | 3 | on: [push] 4 | 5 | jobs: 6 | phpcs: 7 | runs-on: ubuntu-20.04 8 | 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v1 12 | 13 | - name: Setup composer cache 14 | uses: actions/cache@v2 15 | with: 16 | path: ~/.composer/cache 17 | key: php-composer-${{ hashFiles('**/composer.json') }} 18 | restore-keys: php-composer- 19 | 20 | - name: Set php version to 7.4 21 | uses: shivammathur/setup-php@v2 22 | with: 23 | php-version: "7.4" 24 | 25 | - name: Install composer dependencies 26 | run: composer install 27 | 28 | - name: Run phpcs 29 | run: composer phpcs 30 | -------------------------------------------------------------------------------- /.github/workflows/phpunit.yml: -------------------------------------------------------------------------------- 1 | name: phpunit tests 2 | 3 | on: [push] 4 | 5 | jobs: 6 | phpunit-tests: 7 | runs-on: ubuntu-20.04 8 | 9 | services: 10 | mysql: 11 | image: mysql:8.0.23 12 | ports: 13 | - 3306:3306 14 | env: 15 | MYSQL_ROOT_PASSWORD: root 16 | 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v1 20 | 21 | - name: Setup composer cache 22 | uses: actions/cache@v2 23 | with: 24 | path: ~/.composer/cache 25 | key: php-composer-${{ hashFiles('**/composer.json') }} 26 | restore-keys: php-composer- 27 | 28 | - name: Set php version to 7.4 29 | uses: shivammathur/setup-php@v2 30 | with: 31 | php-version: "7.4" 32 | 33 | - name: Install composer dependencies 34 | run: composer install 35 | 36 | - name: Install WordPress 37 | run: ./bin/install-wp-tests.sh frontity_tests root root 127.0.0.1 latest 38 | 39 | - name: Run phpunit 40 | run: composer phpunit 41 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | release: 10 | name: Release 11 | runs-on: ubuntu-20.04 12 | steps: 13 | - name: Checkout Repo 14 | uses: actions/checkout@master 15 | with: 16 | # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits 17 | fetch-depth: 0 18 | 19 | - name: Setup Node.js 12.x 20 | uses: actions/setup-node@master 21 | with: 22 | node-version: 12.x 23 | 24 | - name: Install Dependencies 25 | run: npm install 26 | 27 | - name: Create Release Pull Request 28 | uses: changesets/action@master 29 | with: 30 | version: npm run version 31 | env: 32 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Dependency directories 7 | node_modules/ 8 | vendor/ 9 | 10 | # local vscode config 11 | .vscode 12 | 13 | # build folders 14 | plugins/*/admin/build 15 | build 16 | 17 | # env files 18 | .env 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Frontity WP Plugins 2 | 3 | ## How to collaborate 4 | 5 | #### 1. Fork this repo to your GitHub account. 6 | 7 | #### 2. Clone the fork in your computer. 8 | 9 | #### 3. Add the plugins to your WordPress installation. 10 | 11 | You can add them using symlinks: 12 | 13 | ```bash 14 | npm run sync ../../path/to/your/wordpress 15 | ``` 16 | 17 | If you work with [Local by Flywheel](https://localbyflywheel.com/) you have to use their addon [ Volumes ](https://localbyflywheel.com/add-ons/volumes) to add the plugins to the WordPress. 18 | 19 | #### 4. Make the modifications to the code. 20 | 21 | #### 5. Submit a Pull Request. 22 | 23 | ## WordPress Code Standards and Unit Tests 24 | 25 | ### Installation in macOS 26 | 27 | #### 1. Install PHP. 28 | 29 | Our recommendation is to use Homebrew: 30 | 31 | ```bash 32 | brew install php 33 | ``` 34 | 35 | #### 2. Install Composer. 36 | 37 | Our recommendation is to use Hombrew: 38 | 39 | ```bash 40 | brew install composer 41 | ``` 42 | 43 | Then, install the dependencies: 44 | 45 | ```bash 46 | composer install 47 | ``` 48 | 49 | #### 3. Install MySQL (for unit tests only) 50 | 51 | Our recommendation is to use [DBngin](https://dbngin.com/). 52 | 53 | Once you've installed DBngin, create a new MySQL database (v5.7) and click on "Start". 54 | 55 | Then, click on the terminal icon and add the line it shows 56 | to your `.bash_profile` or `.zshrc` file: 57 | 58 | ```bash 59 | # DBngin exports 60 | export PATH=/Users/Shared/DBngin/mysql/5.7.23/bin:$PATH 61 | ``` 62 | 63 | Change `5.7.23` for your MySQL version. 64 | 65 | #### 4. Install Xdebug (for debugging of unit tests) 66 | 67 | Our recommendation is to use `pecl`: 68 | 69 | ```bash 70 | pecl install xdebug 71 | ``` 72 | 73 | After the installation, add an extension with the Xdebug configuration at `/usr/local/etc/php/7.X/conf.d/ext-xdebug.ini`: 74 | 75 | ``` 76 | [xdebug] 77 | zend_extension=/usr/local/Cellar/php/7.X/pecl/YYYYYYYY/xdebug.so 78 | xdebug.remote_enable=1 79 | xdebug.remote_port=9000 80 | ``` 81 | 82 | Change `7.X` for your PHP version and YYYYYY for the folder where pecl installed Xdebug. 83 | 84 | You may need to clean your previous PHP installation first, then install it again with brew. [This post](https://medium.com/@romaninsh/install-php-7-2-xdebug-on-macos-high-sierra-with-homebrew-july-2018-d7968fe7e8b8) explains the process. You can skip the Nginx section. 85 | 86 | You may need to remove the first line that the pecl installation added to your `php.ini` file at `/usr/local/etc/php/7.X/php.ini`. 87 | 88 | ### Run the code standards and beautifier 89 | 90 | You can use these two commands to check that your code meets the WordPress standards: 91 | 92 | ```bash 93 | npm run phpcs 94 | npm run phpcbf 95 | ``` 96 | 97 | ### Run the unit tests 98 | 99 | The first time, you need to install the database and download WordPress 100 | 101 | ```bash 102 | npm run install-wp-tests 103 | ``` 104 | 105 | This will run `bin/install-wp-tests.sh` with the following parameters: 106 | 107 | - DB_NAME=frontity-tests 108 | - DB_USER=root 109 | - DB_PASS='' (blank) 110 | - DB_HOST=localhost 111 | - WP_VERSION=latest 112 | - SKIP_DB_CREATE=false 113 | 114 | You can also run it manually if you prefer. 115 | 116 | Then, use `npm run phpunit` to run the tests. 117 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | "@babel/preset-env", 5 | { 6 | targets: { 7 | edge: "16", 8 | firefox: "50", 9 | chrome: "50", 10 | safari: "10" 11 | }, 12 | useBuiltIns: "entry", 13 | corejs: 3 14 | } 15 | ], 16 | "@babel/preset-react" 17 | ] 18 | }; 19 | -------------------------------------------------------------------------------- /bin/install-wp-tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ $# -lt 3 ]; then 4 | echo "usage: $0 [db-host] [wp-version] [skip-database-creation]" 5 | exit 1 6 | fi 7 | 8 | DB_NAME=$1 9 | DB_USER=$2 10 | DB_PASS=$3 11 | DB_HOST=${4-localhost} 12 | WP_VERSION=${5-latest} 13 | SKIP_DB_CREATE=${6-false} 14 | 15 | TMPDIR=${TMPDIR-/tmp} 16 | TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//") 17 | WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib} 18 | WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress/} 19 | 20 | download() { 21 | if [ `which curl` ]; then 22 | curl -s "$1" > "$2"; 23 | elif [ `which wget` ]; then 24 | wget -nv -O "$2" "$1" 25 | fi 26 | } 27 | 28 | if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+\-(beta|RC)[0-9]+$ ]]; then 29 | WP_BRANCH=${WP_VERSION%\-*} 30 | WP_TESTS_TAG="branches/$WP_BRANCH" 31 | 32 | elif [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then 33 | WP_TESTS_TAG="branches/$WP_VERSION" 34 | elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then 35 | if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then 36 | # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x 37 | WP_TESTS_TAG="tags/${WP_VERSION%??}" 38 | else 39 | WP_TESTS_TAG="tags/$WP_VERSION" 40 | fi 41 | elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then 42 | WP_TESTS_TAG="trunk" 43 | else 44 | # http serves a single offer, whereas https serves multiple. we only want one 45 | download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json 46 | grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json 47 | LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') 48 | if [[ -z "$LATEST_VERSION" ]]; then 49 | echo "Latest WordPress version could not be found" 50 | exit 1 51 | fi 52 | WP_TESTS_TAG="tags/$LATEST_VERSION" 53 | fi 54 | set -ex 55 | 56 | install_wp() { 57 | 58 | if [ -d $WP_CORE_DIR ]; then 59 | return; 60 | fi 61 | 62 | mkdir -p $WP_CORE_DIR 63 | 64 | if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then 65 | mkdir -p $TMPDIR/wordpress-nightly 66 | download https://wordpress.org/nightly-builds/wordpress-latest.zip $TMPDIR/wordpress-nightly/wordpress-nightly.zip 67 | unzip -q $TMPDIR/wordpress-nightly/wordpress-nightly.zip -d $TMPDIR/wordpress-nightly/ 68 | mv $TMPDIR/wordpress-nightly/wordpress/* $WP_CORE_DIR 69 | else 70 | if [ $WP_VERSION == 'latest' ]; then 71 | local ARCHIVE_NAME='latest' 72 | elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then 73 | # https serves multiple offers, whereas http serves single. 74 | download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json 75 | if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then 76 | # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x 77 | LATEST_VERSION=${WP_VERSION%??} 78 | else 79 | # otherwise, scan the releases and get the most up to date minor version of the major release 80 | local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'` 81 | LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1) 82 | fi 83 | if [[ -z "$LATEST_VERSION" ]]; then 84 | local ARCHIVE_NAME="wordpress-$WP_VERSION" 85 | else 86 | local ARCHIVE_NAME="wordpress-$LATEST_VERSION" 87 | fi 88 | else 89 | local ARCHIVE_NAME="wordpress-$WP_VERSION" 90 | fi 91 | download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz 92 | tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR 93 | fi 94 | 95 | download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php 96 | } 97 | 98 | install_test_suite() { 99 | # portable in-place argument for both GNU sed and Mac OSX sed 100 | if [[ $(uname -s) == 'Darwin' ]]; then 101 | local ioption='-i.bak' 102 | else 103 | local ioption='-i' 104 | fi 105 | 106 | # set up testing suite if it doesn't yet exist 107 | if [ ! -d $WP_TESTS_DIR ]; then 108 | # set up testing suite 109 | mkdir -p $WP_TESTS_DIR 110 | svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes 111 | svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data 112 | fi 113 | 114 | if [ ! -f wp-tests-config.php ]; then 115 | download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php 116 | # remove all forward slashes in the end 117 | WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::") 118 | sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php 119 | sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php 120 | sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php 121 | sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php 122 | sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php 123 | fi 124 | 125 | } 126 | 127 | install_db() { 128 | 129 | if [ ${SKIP_DB_CREATE} = "true" ]; then 130 | return 0 131 | fi 132 | 133 | # parse DB_HOST for port or socket references 134 | local PARTS=(${DB_HOST//\:/ }) 135 | local DB_HOSTNAME=${PARTS[0]}; 136 | local DB_SOCK_OR_PORT=${PARTS[1]}; 137 | local EXTRA="" 138 | 139 | if ! [ -z $DB_HOSTNAME ] ; then 140 | if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then 141 | EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" 142 | elif ! [ -z $DB_SOCK_OR_PORT ] ; then 143 | EXTRA=" --socket=$DB_SOCK_OR_PORT" 144 | elif ! [ -z $DB_HOSTNAME ] ; then 145 | EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" 146 | fi 147 | fi 148 | 149 | # create database 150 | mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA 151 | } 152 | 153 | install_wp 154 | install_test_suite 155 | install_db 156 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontity/wp-plugins", 3 | "description": "WordPress plugins suite made to enhance WordPress for the Frontity framework.", 4 | "homepage": "https://frontity.org", 5 | "type": "wordpress-plugin", 6 | "license": "GPL-2.0-or-later", 7 | "support": { 8 | "issues": "https://github.com/frontity/wp-plugins/issues" 9 | }, 10 | "require-dev": { 11 | "automattic/vipwpcs": "^2.0.0", 12 | "wp-coding-standards/wpcs": "^2.3", 13 | "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", 14 | "phpcompatibility/phpcompatibility-wp": "^2.1", 15 | "phpunit/phpunit": "^7.0" 16 | }, 17 | "scripts": { 18 | "phpcbf": "vendor/bin/phpcbf", 19 | "phpcs": "vendor/bin/phpcs", 20 | "phpunit": "vendor/bin/phpunit" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wp-plugins", 3 | "description": "A set of WordPress enchancement to improve the integration with the Frontity Framework", 4 | "private": true, 5 | "homepage": "https://github.com/frontity/wp-plugins#readme", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/frontity/wp-plugins.git" 9 | }, 10 | "bugs": { 11 | "url": "https://github.com/frontity/wp-plugins/issues" 12 | }, 13 | "workspaces": [ 14 | "plugins/*" 15 | ], 16 | "scripts": { 17 | "dev": "webpack --watch", 18 | "build": "node scripts/build.js", 19 | "sync": "node ./scripts/symlink.js", 20 | "sync:prod": "node ./scripts/symlink.js --production", 21 | "install-wp-tests": "./bin/install-wp-tests.sh frontity_tests root '' 127.0.0.1 latest", 22 | "phpcs": "composer run phpcs", 23 | "phpcbf": "composer run phpcbf", 24 | "phpunit": "composer run phpunit", 25 | "version": "npx changeset version && node scripts/version.js" 26 | }, 27 | "dependencies": { 28 | "@emotion/core": "^10.0.22", 29 | "@emotion/styled": "^10.0.23", 30 | "@frontity/connect": "^1.0.1", 31 | "axios": "^0.21.1", 32 | "chalk": "^2.4.2", 33 | "minimist": "^1.2.3" 34 | }, 35 | "devDependencies": { 36 | "@babel/core": "^7.4.5", 37 | "@babel/preset-env": "^7.4.5", 38 | "@babel/preset-react": "^7.0.0", 39 | "@changesets/changelog-github": "^0.2.0", 40 | "@changesets/cli": "^2.14.1", 41 | "babel-loader": "^8.0.6", 42 | "core-js": "^3.1.4", 43 | "fs-extra": "^8.1.0", 44 | "react": "^16.8.6", 45 | "react-dom": "^16.8.6", 46 | "replace-in-file": "^3.4.3", 47 | "simple-git": "^1.107.0", 48 | "symlink-dir": "^3.1.0", 49 | "webpack": "^4.35.0", 50 | "webpack-cli": "^3.3.5" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /phpcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | . 5 | /vendor/ 6 | /node_modules/ 7 | /build/ 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | ./tests/frontity-headtags/ 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # frontity-headtags 2 | 3 | ## 1.2.1 4 | 5 | ### Patch Changes 6 | 7 | - [`8a28bb2`](https://github.com/frontity/wp-plugins/commit/8a28bb2440ed93e2c1ff536c61bd948817119df5) [#51](https://github.com/frontity/wp-plugins/pull/51) - Return an empty array when there is no `` tag. 8 | 9 | ## 1.2.0 10 | 11 | ### Minor Changes 12 | 13 | - [`8872e6d`](https://github.com/frontity/wp-plugins/commit/8872e6d446b03e8680bf6be69e38c63146fd7fc8) [#49](https://github.com/frontity/wp-plugins/pull/49) - Add support for the latest version of the All In One SEO plugin (^4.0.16). 14 | 15 | ## 1.1.4 16 | 17 | ### Patch Changes 18 | 19 | - [`0c39e5b`](https://github.com/frontity/wp-plugins/commit/0c39e5b46d79c083dc23943ba85c134a196f4d16) [#34](https://github.com/frontity/wp-plugins/pull/34) - Remove warning messages from REST API responses when head's HTML code is malformed 20 | 21 | ## 1.1.3 22 | 23 | ### Patch Changes 24 | 25 | - [`a46927b`](https://github.com/frontity/wp-plugins/commit/a46927bbde468157e85fe247b72ad44895ccf50d) [#29](https://github.com/frontity/wp-plugins/pull/29) - Fix redirects to images when making calls to the REST API in a site with Yoast installed. Also, refactor the code to prevent other redirections in the future. 26 | 27 | ## 1.1.2 28 | 29 | ### Patch Changes 30 | 31 | - [`8159151`](https://github.com/frontity/wp-plugins/commit/81591510a74fc053999e78ea9fd690d50f760bde) [#23](https://github.com/frontity/wp-plugins/pull/23) - Fix the performance of the clear cache functionality. 32 | 33 | * [`f15f02a`](https://github.com/frontity/wp-plugins/commit/f15f02a2f0163547ab120b918455df1ff73eb2d7) [#22](https://github.com/frontity/wp-plugins/pull/22) - Fix the way admin hooks and rest api hooks are being registered. 34 | 35 | - `admin_init` is used for `register_admin_hooks` 36 | - `rest_api_init` is used for `register_rest_hooks` 37 | 38 | ## 1.1.1 39 | 40 | ### Patch Changes 41 | 42 | - [`fab8711`](https://github.com/frontity/wp-plugins/commit/fab87113b088c8d37426bce58ad997a135a33c56) [#21](https://github.com/frontity/wp-plugins/pull/21) - Fix redirects when making calls to the REST API 43 | 44 | ## 1.1.0 45 | 46 | ### Minor Changes 47 | 48 | - [`12638a8`](https://github.com/frontity/wp-plugins/commit/12638a86dab060a3ec5a948b83dd5ea912ae413f) [#17](https://github.com/frontity/wp-plugins/pull/17) - Added integration with All In One SEO Pack. 49 | 50 | ## 1.0.1 51 | 52 | ### Patch Changes 53 | 54 | - [`0200a05`](https://github.com/frontity/wp-plugins/commit/0200a05ddb59d577d69eef54e7632e38a91b2eba) [#16](https://github.com/frontity/wp-plugins/pull/16) - Fix the registering of activation / deactivation hooks. 55 | 56 | ## 1.0.0 57 | 58 | ### Major Changes 59 | 60 | - Release the first version of REST API - Head Tags 61 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/button.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "@emotion/styled"; 3 | 4 | const Button = ({ icon, primary, children, ...props }) => { 5 | return ( 6 | 7 | {icon || null} 8 | {children} 9 | 10 | ); 11 | }; 12 | 13 | export default Button; 14 | 15 | const Anchor = styled.button` 16 | height: 32px; 17 | padding: 0 16px; 18 | display: flex; 19 | flex-direction: row; 20 | align-items: center; 21 | border-radius: 8px; 22 | box-sizing: border-box; 23 | box-shadow: ${({ primary }) => 24 | primary 25 | ? "0 1px 4px 0 rgba(12, 17, 43, 0.16), 0 4px 8px 0 rgba(12, 17, 43, 0.12)" 26 | : "0 1px 4px 0 rgba(12, 17, 43, 0.12), 0 1px 4px 0 rgba(12, 17, 43, 0.16)"}; 27 | 28 | background-color: ${({ primary }) => (primary ? "#1f38c5" : "#ffffff")}; 29 | color: ${({ primary }) => (primary ? "#ffffff" : "#1f38c5")}; 30 | border: ${({ primary }) => 31 | primary ? "none" : "solid 2px rgba(32, 56, 197, 0.4)"}; 32 | 33 | &:focus, 34 | &:hover { 35 | color: ${({ primary }) => (primary ? "#ffffff" : "#1f38c5")}; 36 | border: ${({ primary }) => 37 | primary ? "none" : "solid 2px rgba(32, 56, 197)"}; 38 | } 39 | 40 | font-family: Poppins, sans-serif; 41 | font-size: 12px; 42 | font-weight: 600; 43 | font-stretch: normal; 44 | font-style: normal; 45 | line-height: 1.33; 46 | letter-spacing: 1.2px; 47 | text-transform: uppercase; 48 | text-decoration: none; 49 | white-space: nowrap; 50 | 51 | cursor: pointer; 52 | 53 | svg { 54 | width: 12px; 55 | height: 12px; 56 | padding-right: 8px; 57 | } 58 | `; 59 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/card-link.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "@emotion/styled"; 3 | import TinyCard from "./tiny-card"; 4 | import Arrow from "./icons/arrow"; 5 | 6 | const CardLink = ({ children, ...props }) => { 7 | return ( 8 | 9 | 10 | {children} 11 | 12 | 13 | ); 14 | }; 15 | 16 | export default CardLink; 17 | 18 | const Link = styled.a` 19 | color: #1f38c5; 20 | font-size: 12px; 21 | font-weight: 600; 22 | line-height: 1.33; 23 | letter-spacing: 1.2px; 24 | text-transform: uppercase; 25 | text-decoration: none; 26 | white-space: nowrap; 27 | cursor: pointer; 28 | &:hover, 29 | &:focus { 30 | color: #1f38c5; 31 | text-decoration: none; 32 | span { 33 | border-bottom: 2px solid #1f38c5; 34 | } 35 | } 36 | `; 37 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/card.js: -------------------------------------------------------------------------------- 1 | import styled from "@emotion/styled"; 2 | 3 | export default styled.div` 4 | position: relative; 5 | margin: ${({ margin }) => margin || 0}; 6 | padding: 32px; 7 | background-color: #ffffff; 8 | box-sizing: border-box; 9 | box-shadow: 0 1px 4px 0 rgba(31, 56, 197, 0.12), 10 | 0 8px 12px 0 rgba(31, 56, 197, 0.12); 11 | border-radius: 4px; 12 | `; 13 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/footer.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "@emotion/styled"; 3 | import TinyCard from "./tiny-card"; 4 | import Link from "./link"; 5 | import GitHub from "./icons/github"; 6 | import Frontity from "./icons/frontity"; 7 | import Twitter from "./icons/twitter"; 8 | import Info from "./icons/info"; 9 | import Heart from "./icons/heart"; 10 | 11 | const Footer = () => { 12 | return ( 13 | 14 | 15 | 16 | 17 | 18 | Any problem or questions? Join our community forum 19 | and let us know, we'll be happy to help! 20 | 21 | } 23 | href="https://community.frontity.org?utm_source=plugin-dashboard&utm_medium=link&utm_campaign=rest-api-head-tags-plugin" 24 | target="_blank" 25 | > 26 | Ask the community 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Frontity is an open source framework for building headless WordPress 35 | sites with ReactJS. If you like the project, you can show your support 36 | by leaving a positive review here or{" "} 37 | 41 | starring it on GitHub 42 | 43 | . 44 | 45 | 46 | 47 | } 49 | href="https://twitter.com/frontity" 50 | target="_blank" 51 | > 52 | Follow Frontity 53 | 54 | } 56 | href="https://github.com/frontity" 57 | target="_blank" 58 | > 59 | Get involved on GitHub 60 | 61 | } 63 | href="https://frontity.org/#newsletter?utm_source=plugin-dashboard&utm_medium=link&utm_campaign=rest-api-head-tags-plugin" 64 | target="_blank" 65 | > 66 | Get updates about Frontity 67 | 68 | } 70 | href="https://wordpress.org/support/plugin/rest-api-head-tags/reviews/?filter=5" 71 | target="_blank" 72 | > 73 | Leave a positive review 74 | 75 | 76 | 77 | ); 78 | }; 79 | 80 | export default Footer; 81 | 82 | const FooterContainer = styled.footer` 83 | margin: auto; 84 | max-width: 700px; 85 | padding: 0 16px; 86 | `; 87 | 88 | const Links = styled.div` 89 | display: flex; 90 | flex-direction: column; 91 | max-width: 16em; 92 | margin-left: auto; 93 | margin-right: auto; 94 | 95 | & > *:not(:last-child) { 96 | margin-bottom: 2em; 97 | } 98 | `; 99 | 100 | const Row = styled.div` 101 | display: flex; 102 | 103 | @media only screen and (min-width: 968px) { 104 | flex-direction: row; 105 | align-items: baseline; 106 | justify-content: space-between; 107 | & > *:not(:last-child) { 108 | margin-right: ${({ gap }) => gap}px; 109 | } 110 | } 111 | 112 | @media only screen and (max-width: 967px) { 113 | flex-direction: column; 114 | align-items: stretch; 115 | & > *:not(:last-child) { 116 | margin-bottom: ${({ gap }) => gap / 2}px; 117 | } 118 | } 119 | `; 120 | 121 | const Separator = styled.div` 122 | margin: 45px 0; 123 | height: 4px; 124 | opacity: 0.08; 125 | background-color: #1f38c5; 126 | `; 127 | 128 | const InlineLink = styled.a` 129 | &, 130 | &:hover, 131 | &:visited { 132 | color: #1f38c5; 133 | text-decoration: none; 134 | cursor: pointer; 135 | } 136 | `; 137 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/frontity-logo.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | const Logo = ({ color }) => ( 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | ); 14 | 15 | export default Logo; 16 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/global-styles.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Global, css } from "@emotion/core"; 3 | 4 | export default () => ; 5 | 6 | const globalStyles = css` 7 | /* Poppins font */ 8 | @import url("https://fonts.googleapis.com/css?family=Poppins:400,600&display=swap"); 9 | 10 | /* overrides padding and background for wpcontent class */ 11 | div#wpcontent, 12 | .auto-fold div#wpcontent { 13 | padding-left: 0; 14 | background-color: #eef5f8; 15 | } 16 | 17 | #root { 18 | font-family: Poppins, sans-serif; 19 | font-size: 16px; 20 | font-weight: normal; 21 | font-stretch: normal; 22 | font-style: normal; 23 | line-height: 1.5; 24 | letter-spacing: normal; 25 | color: rgba(12, 17, 43, 0.8); 26 | 27 | p { 28 | font-size: 16px; 29 | line-height: 24px; 30 | } 31 | 32 | small { 33 | font-size: 12px; 34 | line-height: 1.33; 35 | color: #24282e; 36 | } 37 | 38 | h1, 39 | h2, 40 | h3, 41 | h4 { 42 | font-weight: 600; 43 | color: #0c112b; 44 | margin: 0; 45 | } 46 | 47 | h1 { 48 | font-size: 32px; 49 | line-height: 40px; 50 | } 51 | h2 { 52 | font-size: 24px; 53 | line-height: 32px; 54 | } 55 | h3 { 56 | font-size: 20px; 57 | line-height: 24px; 58 | } 59 | h4 { 60 | font-size: 14px; 61 | line-height: 20px; 62 | } 63 | 64 | label { 65 | font-size: 14px; 66 | font-weight: 600; 67 | letter-spacing: 1.5px; 68 | text-transform: uppercase; 69 | color: #000000; 70 | } 71 | } 72 | `; 73 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/header.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "@emotion/styled"; 3 | import Button from "./button"; 4 | import FrontityIcon from "./icons/frontity"; 5 | import FrontityLogo from "./frontity-logo"; 6 | 7 | const Header = () => { 8 | return ( 9 | 10 | 11 | REST API - Head Tags by{" "} 12 | 16 | 17 | 18 | 19 | 20 | 27 | 36 | 37 | 38 | ); 39 | }; 40 | 41 | export default Header; 42 | 43 | const HeaderContainer = styled.div` 44 | background-color: #ffffff; 45 | box-sizing: border-box; 46 | box-shadow: 0 1px 4px 0 rgba(31, 56, 197, 0.12); 47 | display: flex; 48 | flex-direction: row; 49 | justify-content: space-between; 50 | align-items: center; 51 | padding: 16px 32px; 52 | 53 | @media (max-width: 1139px) { 54 | flex-direction: column; 55 | text-align: center; 56 | } 57 | `; 58 | 59 | const HeaderTitle = styled.h2``; 60 | 61 | const HeaderButtons = styled.div` 62 | display: flex; 63 | flex-direction: row; 64 | justify-content: space-between; 65 | 66 | @media (max-width: 1139px) { 67 | margin-top: 16px; 68 | } 69 | 70 | @media (max-width: 589px) { 71 | flex-direction: column; 72 | } 73 | 74 | @media (min-width: 590px) { 75 | & > * { 76 | margin-right: 16px; 77 | } 78 | 79 | & > *:last-child { 80 | margin-right: 0; 81 | } 82 | } 83 | 84 | @media (max-width: 589px) { 85 | & > * { 86 | margin-bottom: 8px; 87 | } 88 | 89 | & > *:last-child { 90 | margin-bottom: 0; 91 | } 92 | } 93 | `; 94 | 95 | const FrontityLogoContainer = styled.a` 96 | svg { 97 | height: 0.8em; 98 | margin-left: 8px; 99 | overflow: visible; 100 | vertical-align: baseline; 101 | } 102 | `; 103 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/icons/arrow.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "@emotion/styled"; 3 | 4 | export default ({ color, size }) => ( 5 | 19 | 20 | 21 | 22 | 23 | 24 | ); 25 | 26 | const Svg = styled.svg` 27 | width: ${({ size }) => size}px; 28 | height: ${({ size }) => size}px; 29 | flex-shrink: 0; 30 | flex-growth: 0; 31 | `; 32 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/icons/check.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "@emotion/styled"; 3 | 4 | const Check = ({ color, size }) => ( 5 | 6 | 7 | 8 | ); 9 | 10 | export default Check; 11 | 12 | const Svg = styled.svg` 13 | width: ${({ size }) => size}px; 14 | height: ${({ size }) => size}px; 15 | flex-shrink: 0; 16 | flex-growth: 0; 17 | `; 18 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/icons/close.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "@emotion/styled"; 3 | 4 | const Close = ({ color, size }) => ( 5 | 6 | 7 | 8 | ); 9 | 10 | export default Close; 11 | 12 | const Svg = styled.svg` 13 | width: ${({ size }) => size}px; 14 | height: ${({ size }) => size}px; 15 | flex-shrink: 0; 16 | flex-growth: 0; 17 | `; 18 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/icons/frontity.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "@emotion/styled"; 3 | 4 | export default ({ color, size }) => ( 5 | 6 | 7 | 8 | 9 | ); 10 | 11 | const Svg = styled.svg` 12 | width: ${({ size }) => size}px; 13 | height: ${({ size }) => size}px; 14 | flex-shrink: 0; 15 | flex-growth: 0; 16 | `; 17 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/icons/github.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default () => ( 4 | 9 | 10 | 11 | ); 12 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/icons/heart.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "@emotion/styled"; 3 | 4 | export default ({ color, size, solid }) => ( 5 | 6 | 10 | 11 | 12 | ); 13 | 14 | const Svg = styled.svg` 15 | width: ${({ size }) => size}px; 16 | height: ${({ size }) => size}px; 17 | flex-shrink: 0; 18 | flex-growth: 0; 19 | `; 20 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/icons/info.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "@emotion/styled"; 3 | 4 | export default ({ color, size }) => ( 5 | 6 | 10 | 11 | 12 | ); 13 | 14 | const Svg = styled.svg` 15 | width: ${({ size }) => size}px; 16 | height: ${({ size }) => size}px; 17 | flex-shrink: 0; 18 | flex-growth: 0; 19 | `; 20 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/icons/triangle.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "@emotion/styled"; 3 | 4 | export default ({ color, size, pointingDown }) => ( 5 | 11 | 12 | 13 | ); 14 | 15 | const Svg = styled.svg` 16 | width: ${({ size }) => size}px; 17 | height: ${({ size }) => size}px; 18 | flex-shrink: 0; 19 | flex-growth: 0; 20 | transform: ${({ pointingDown }) => 21 | pointingDown ? "rotate(180deg)" : "none"}; 22 | `; 23 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/icons/twitter.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export default () => ( 4 | 9 | 10 | 11 | ); 12 | -------------------------------------------------------------------------------- /plugins/frontity-headtags/admin/components/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import GlobalStyles from "./global-styles"; 3 | import Header from "./header"; 4 | import Main from "./main"; 5 | import Footer from "./footer"; 6 | 7 | const YoastPlugin = () => { 8 | return ( 9 | <> 10 | 11 |
12 |
13 |