diff --git a/.babel.config.js b/.babel.config.js new file mode 100644 index 0000000..1d17e99 --- /dev/null +++ b/.babel.config.js @@ -0,0 +1,31 @@ +module.exports = { + presets: [ + [ + "@babel/preset-env", + { + "modules": "commonjs", + "useBuiltIns" : "usage", + "corejs": "3.0.0", + } + ], + [ + "@babel/preset-react", + { + development: process.env.NODE_ENV === "development", + }, + ], + ], + plugins: [ + '@babel/plugin-transform-object-assign', + '@babel/plugin-transform-runtime', + '@babel/plugin-transform-modules-commonjs', + '@babel/plugin-transform-arrow-functions', + '@babel/plugin-transform-async-to-generator', + '@babel/plugin-proposal-class-properties', + '@babel/plugin-proposal-object-rest-spread', + '@babel/plugin-proposal-export-default-from', + [ + '@babel/plugin-proposal-decorators', { 'legacy': true } + ] + ] +} diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 785c2ad..0000000 --- a/.babelrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presets": [ - ["env", { - "targets": { - "browsers": ["> 0.5%", "last 2 versions", "iOS >= 8", "IE 10", "IE 11"] - } - }] - ], - "plugins": [ - ["transform-class-properties", { "spec": true }] - ] -} diff --git a/.travis.yml b/.travis.yml index 2e3874b..b71a1c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ -dist: trusty +dist: xenial language: php +services: + - mysql + notifications: email: on_success: never @@ -18,7 +21,11 @@ cache: matrix: include: - - php: 7.4snapshot + - php: 7.4 + env: WP_VERSION=nightly CODE_STYLES=phpcs + - php: 7.4 + env: WP_VERSION=5.4 CODE_STYLES=phpcs + - php: 7.3 env: WP_VERSION=nightly CODE_STYLES=phpcs - php: 7.3 env: WP_VERSION=5.3 CODE_STYLES=phpcs @@ -42,6 +49,8 @@ matrix: env: WP_VERSION=nightly PHP_UNIT=6 - php: 5.6 env: WP_VERSION=nightly PHP_UNIT=5 + - php: 5.6 + env: WP_VERSION=5.4 PHP_UNIT=5 - php: 5.6 env: WP_VERSION=5.3 PHP_UNIT=5 - php: 5.6 diff --git a/README.md b/README.md index 733bf9b..bae34c5 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,12 @@ To download just the plugin (without the developer extras in this repo) check ou ### Compatibility -[![WordPress Compatibility](https://img.shields.io/badge/WordPress-4.7_to_5.3-blue.svg?logo=wordpress)](https://wordpress.org/) [![PHP Compatibility](https://img.shields.io/badge/PHP-5.6_to_7.3-%238892BF.svg?logo=php)](https://php.net/) +[![WordPress Compatibility](https://img.shields.io/badge/WordPress-4.7_to_5.4-blue.svg?logo=wordpress)](https://wordpress.org/) [![PHP Compatibility](https://img.shields.io/badge/PHP-5.6_to_7.4-%238892BF.svg?logo=php)](https://php.net/) utm.codes is developed for, and tested with, a variety of recent platform versions, including: -- WordPress 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, and 5.3 -- PHP 5.6, 7.0, 7.1, 7.2, and 7.3 +- WordPress 4.7, 4.8, 4.9, 5.0, 5.1, 5.2, 5.3, and 5.4 +- PHP 5.6, 7.0, 7.1, 7.2, 7.3, and 7.4 ## Branches diff --git a/README.txt b/README.txt index c331e29..80ffeb9 100644 --- a/README.txt +++ b/README.txt @@ -3,9 +3,9 @@ Contributors: chrislarrycarl Donate link: https://utm.codes/pricing/ Tags: analytics, utm codes, analytics, google analytics, campaign marketing, link generator Requires at least: 4.7.0 -Tested up to: 5.3 +Tested up to: 5.4.0 Requires PHP: 5.6.0 -Stable tag: 1.6.3 +Stable tag: 1.7.0 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -34,7 +34,7 @@ For more information, videos, and helpful tips [visit the utm.codes website](htt - Supports adding additional custom parameters to links for improved versatility - Multi-user access within WordPress to share creation and management responsibilities - See your current link count in the admin dashboard "At a Glance" -- Works with PHP 5.6, 7.0, 7.1, 7.2, and 7.3 +- Works with PHP 5.6, 7.0, 7.1, 7.2, 7.3, and 7.4 - 100% Free and Open Source = Installation = @@ -65,7 +65,7 @@ Shortening links requires a shortener be configured. Configure shortening under = Why is the create social links checkbox missing when I create a link? = -Batch social link creation requires selection of social networks. Select networks under Settings > utm.codes to create links for when batch creating social links. +Batch social link creation requires selection of social networks. Select networks under Settings > utm.codes to create links for your preferred networks when batch creating social links. = What if I need custom parameters in my links? = @@ -92,11 +92,16 @@ That isn't a question. But thank you. 1. The links list provides easy access to search, filter, edit, and copy links 2. Shorten links just by clicking the checkbox 3. Create social links in batch just by clicking the checkbox -4. Configure settings for link format, your favorite social networks, Bitly API key, and more +4. Configure settings for link format, labels, link notes, your favorite social networks, and shortener 5. See your link count in the WordPress dashboard "At a Glance" == Changelog == += 1.7.0 = + +- Supports WordPress v5.4 +- New use your custom domain when shortening with Rebrandly + = 1.6.3 = This release doesn't add new functionality, however, it does add a bit of needed housekeeping and increments tested up to for WordPress v5.3 diff --git a/_build/javascript/settings/select.js b/_build/javascript/settings/select.js index bf981e8..a2ff241 100644 --- a/_build/javascript/settings/select.js +++ b/_build/javascript/settings/select.js @@ -3,11 +3,19 @@ $(function () { $('#utmdclink_shortener').on('change', function(event){ + if('none' !== $(this).val()) { - $('#utmdclink_shortener_api_row').removeClass("hidden"); + $('#utmdclinks_shortener_api_row').removeClass("hidden"); } else { - $('#utmdclink_shortener_api_row').addClass("hidden"); + $('#utmdclinks_shortener_api_row').addClass("hidden"); } + + if('rebrandly' === $(this).val()) { + $('#utmdclinks_shortener_custom_domain_row').removeClass("hidden"); + } else { + $('#utmdclinks_shortener_custom_domain_row').addClass("hidden"); + } + }); }); diff --git a/_build/javascript/index.js b/_build/javascript/utmdotcodes.js similarity index 100% rename from _build/javascript/index.js rename to _build/javascript/utmdotcodes.js diff --git a/_build/styles/mixins/_slider.scss b/_build/styles/mixins/_slider.scss index 3bff29e..5cd82de 100644 --- a/_build/styles/mixins/_slider.scss +++ b/_build/styles/mixins/_slider.scss @@ -43,7 +43,7 @@ &::-moz-focus-outer { border: 0; } - + &::-moz-range-track { width: 100%; height: $track_height; diff --git a/_build/styles/partials/_dashboard.scss b/_build/styles/partials/_dashboard.scss index c439c0f..2f7aa54 100644 --- a/_build/styles/partials/_dashboard.scss +++ b/_build/styles/partials/_dashboard.scss @@ -5,7 +5,7 @@ &::before { content: "\f103" !important; color: transparent !important; - background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yMi4yMjIyMjIyMjIyMjIyMjUgLTIyLjIyMjIyMjIyMjIyMjIyNSAxNDQuNDQ0NDQ0NDQ0NDQ0NDYgMTU1LjU1NTU1NTU1NTU1NTU3IiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTYuNjY2NjY2NjY2NjY2NjY0IC0xMS4xMTExMTExMTExMTExMSkgc2NhbGUoNS41NTU1NTU1NTU1NTU1NTUpIj48ZyBmaWxsPSIjODI4NzhjIj48cGF0aCBkPSJNMTUgMmMtMS42IDAtMy4xLjctNC4yIDEuNy44LjIgMS41LjUgMi4xLjkuNi0uNCAxLjMtLjYgMi4xLS42IDIuMiAwIDQgMS44IDQgNHY1YzAgMi4yLTEuOCA0LTQgNHMtNC0xLjgtNC00VjkuNWMtLjUtLjYtMS4yLTEtMi0xVjEzYzAgMy4zIDIuNyA2IDYgNnM2LTIuNyA2LTZWOGMwLTMuMy0yLjctNi02LTZ6Ij48L3BhdGg+PHBhdGggZD0iTTkgMjJjMS42IDAgMy4xLS43IDQuMi0xLjctLjgtLjItMS41LS41LTIuMS0uOS0uNi40LTEuMy42LTIuMS42LTIuMiAwLTQtMS44LTQtNHYtNWMwLTIuMiAxLjgtNCA0LTRzNCAxLjggNCA0djMuNWMuNS42IDEuMiAxIDIgMVYxMWMwLTMuMy0yLjctNi02LTZzLTYgMi43LTYgNnY1YzAgMy4zIDIuNyA2IDYgNnoiPjwvcGF0aD48L2c+PC9nPjwvc3ZnPg==") !important; + background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yMi4yMjIyMjIyMjIyMjIyMjUgLTIyLjIyMjIyMjIyMjIyMjIyNSAxNDQuNDQ0NDQ0NDQ0NDQ0NDYgMTU1LjU1NTU1NTU1NTU1NTU3IiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTYuNjY2NjY2NjY2NjY2NjY0IC0xMS4xMTExMTExMTExMTExMSkgc2NhbGUoNS41NTU1NTU1NTU1NTU1NTUpIj48ZyBmaWxsPSIjODI4NzhjIj48cGF0aCBkPSJNMTUgMmMtMS42IDAtMy4xLjctNC4yIDEuNy44LjIgMS41LjUgMi4xLjkuNi0uNCAxLjMtLjYgMi4xLS42IDIuMiAwIDQgMS44IDQgNHY1YzAgMi4yLTEuOCA0LTQgNHMtNC0xLjgtNC00VjkuNWMtLjUtLjYtMS4yLTEtMi0xVjEzYzAgMy4zIDIuNyA2IDYgNnM2LTIuNyA2LTZWOGMwLTMuMy0yLjctNi02LTZ6Ij48L3BhdGg+PHBhdGggZD0iTTkgMjJjMS42IDAgMy4xLS43IDQuMi0xLjctLjgtLjItMS41LS41LTIuMS0uOS0uNi40LTEuMy42LTIuMS42LTIuMiAwLTQtMS44LTQtNHYtNWMwLTIuMiAxLjgtNCA0LTRzNCAxLjggNCA0djMuNWMuNS42IDEuMiAxIDIgMVYxMWMwLTMuMy0yLjctNi02LTZzLTYgMi43LTYgNnY1YzAgMy4zIDIuNyA2IDYgNnoiPjwvcGF0aD48L2c+PC9nPjwvc3ZnPg==) !important; background-size: auto 100%; background-repeat: no-repeat; } diff --git a/_build/styles/partials/_settings.scss b/_build/styles/partials/_settings.scss index 5f4d80d..7c9f4fb 100644 --- a/_build/styles/partials/_settings.scss +++ b/_build/styles/partials/_settings.scss @@ -112,7 +112,7 @@ appearance: none; background-color: $white; background-image: - url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230084c4%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'), + url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230084c4%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E), linear-gradient(to bottom, $white 0%, $wp_gray 100%); background-repeat: no-repeat, repeat; background-position: right 8px top 50%, 0 0; diff --git a/_build/styles/core.scss b/_build/styles/utmdotcodes.scss similarity index 100% rename from _build/styles/core.scss rename to _build/styles/utmdotcodes.scss diff --git a/_test/README.md b/_test/README.md index 915b871..7bdab80 100644 --- a/_test/README.md +++ b/_test/README.md @@ -17,11 +17,11 @@ The following will help get you up and running PHPUnit tests for the utm.codes p ### PHPUnit Tests -PHPUnit tests support phpunit 5.7 (for PHP 5.6) and phpunit 6.5 (for PHP 7.0, 7.1, and 7.2) +PHPUnit tests support PHPUnit 5.7 (for PHP 5.6), PHPUnit 6.5 (for PHP 7.0, 7.1, and 7.2), and PHPUnit 7.5 (for PHP 7.3, and 7.4). ### PHP Code Sniffer -PHP Code Sniffer v3.3+ is recommended. +PHP Code Sniffer v3.5+, and WordPress coding standards v2.2 are recommended. ## Initial Setup @@ -33,7 +33,7 @@ To get started with composer [click here for installation details](https://getco ### 1. Installing WordPress Tests (Automated) -The install script contained in `bin` will checkout the latest test suite from WordPress and configure your test database. +The install script contained in `bin` will checkout the latest test suite from WordPress and configure your test database. > Note: The install script is included here for convenience but can also be [generated by WP-CLI](https://developer.wordpress.org/cli/commands/scaffold/plugin-tests/). @@ -48,6 +48,7 @@ Update the `config.inc.php` file to your needs: - **WP\_TEST\_DIR** - Path to the WordPress tests directory you setup in Step 1 - **UTMDC\_PLUGIN\_DIR** - Path to the utm.codes plugin you're testing - **UTMDC\_BITLY\_API** - A valid Bitly API Generic Access Token +- **UTMDC\_REBRANDLY]_API** - A valid Rebrandly API Token > Note: Rename to `config.inc.local.php` (ignored in .gitignore) for environment personalization. @@ -61,11 +62,11 @@ Running as single site... To run multisite, use -c tests/phpunit/multisite.xml Not running ajax tests. To execute these, use --group ajax. Not running ms-files tests. To execute these, use --group ms-files. Not running external-http tests. To execute these, use --group external-http. -PHPUnit 7.5.16 by Sebastian Bergmann and contributors. +PHPUnit 7.5.20 by Sebastian Bergmann and contributors. ............................................................. 61 / 61 (100%) -Time: 33.63 seconds, Memory: 44.00 MB +Time: 14.86 seconds, Memory: 40.00 MB OK (61 tests, 516 assertions) @@ -78,7 +79,7 @@ Occasionally a newly installed test suite can throw the error: ``` 1) TestUtmDotCodesUnit::test_is_test -UnexpectedValueException: RecursiveDirectoryIterator::__construct(/tmp/wordpress//wp-content/uploads): +UnexpectedValueException: RecursiveDirectoryIterator::__construct(/tmp/wordpress//wp-content/uploads): failed to open dir: No such file or directory ``` diff --git a/_test/tests/test-integration.php b/_test/tests/test-integration.php index e40e8a2..3916c8f 100644 --- a/_test/tests/test-integration.php +++ b/_test/tests/test-integration.php @@ -965,7 +965,7 @@ function test_settings_register() { $this->assertEquals( count( $wp_registered_settings ), - 9 + 12 ); $this->assertTrue( is_array( $wp_registered_settings['utmdclink_social'] ) ); @@ -1219,32 +1219,37 @@ function test_social_api_filter_hook() { $default_networks = $plugin->get_social_networks(); $this->assertEquals( $default_networks, - [ - 'behance' => [ 'Behance', 'fab fa-behance' ], - 'blogger' => [ 'Blogger', 'fab fa-blogger-b' ], - 'digg' => [ 'Digg', 'fab fa-digg' ], - 'discourse' => [ 'Discourse', 'fab fa-discourse' ], - 'facebook' => [ 'Facebook', 'fab fa-facebook-f' ], - 'flickr' => [ 'Flickr', 'fab fa-flickr' ], - 'github' => [ 'GitHub', 'fab fa-github' ], - 'goodreads' => [ 'Goodreads', 'fab fa-goodreads-g' ], - 'hacker-news' => [ 'Hacker News', 'fab fa-hacker-news' ], - 'instagram' => [ 'Instagram', 'fab fa-instagram' ], - 'linkedin' => [ 'LinkedIn', 'fab fa-linkedin-in' ], - 'medium' => [ 'Medium', 'fab fa-medium-m' ], - 'meetup' => [ 'Meetup', 'fab fa-meetup' ], - 'mix' => [ 'Mix', 'fab fa-mix' ], - 'pinterest' => [ 'Pinterest', 'fab fa-pinterest-p' ], - 'reddit' => [ 'Reddit', 'fab fa-reddit-alien' ], - 'stack-exchange' => [ 'Stack Exchange', 'fab fa-stack-exchange' ], - 'stack-overflow' => [ 'Stack Overflow', 'fab fa-stack-overflow' ], - 'tumblr' => [ 'Tumblr', 'fab fa-tumblr' ], - 'twitter' => [ 'Twitter', 'fab fa-twitter' ], - 'vimeo' => [ 'Vimeo', 'fab fa-vimeo-v' ], - 'xing' => [ 'Xing', 'fab fa-xing' ], - 'yelp' => [ 'Yelp', 'fab fa-yelp' ], - 'youtube' => [ 'YouTube', 'fab fa-youtube' ], - ] + array( + 'behance' => array( 'Behance', 'fab fa-behance' ), + 'blogger' => array( 'Blogger', 'fab fa-blogger-b' ), + 'digg' => array( 'Digg', 'fab fa-digg' ), + 'discourse' => array( 'Discourse', 'fab fa-discourse' ), + 'facebook' => array( 'Facebook', 'fab fa-facebook-f' ), + 'flickr' => array( 'Flickr', 'fab fa-flickr' ), + 'github' => array( 'GitHub', 'fab fa-github' ), + 'goodreads' => array( 'Goodreads', 'fab fa-goodreads-g' ), + 'hacker-news' => array( 'Hacker News', 'fab fa-hacker-news' ), + 'instagram' => array( 'Instagram', 'fab fa-instagram' ), + 'linkedin' => array( 'LinkedIn', 'fab fa-linkedin-in' ), + 'medium' => array( 'Medium', 'fab fa-medium-m' ), + 'meetup' => array( 'Meetup', 'fab fa-meetup' ), + 'mix' => array( 'Mix', 'fab fa-mix' ), + 'odnoklassniki' => array( 'Odnoklassniki', 'fab fa-odnoklassniki'), + 'pinterest' => array( 'Pinterest', 'fab fa-pinterest-p' ), + 'reddit' => array( 'Reddit', 'fab fa-reddit-alien' ), + 'slack' => array( 'Slack', 'fab fa-slack'), + 'stack-exchange' => array( 'Stack Exchange', 'fab fa-stack-exchange' ), + 'stack-overflow' => array( 'Stack Overflow', 'fab fa-stack-overflow' ), + 'tumblr' => array( 'Tumblr', 'fab fa-tumblr' ), + 'twitter' => array( 'Twitter', 'fab fa-twitter' ), + 'vimeo' => array( 'Vimeo', 'fab fa-vimeo-v' ), + 'vk' => array( 'VK', 'fab fa-vk'), + 'weibo' => array( 'Weibo', 'fab fa-weibo'), + 'whatsapp' => array( 'WhatsApp', 'fab fa-whatsapp'), + 'xing' => array( 'Xing', 'fab fa-xing' ), + 'yelp' => array( 'Yelp', 'fab fa-yelp' ), + 'youtube' => array( 'YouTube', 'fab fa-youtube' ), + ) ); add_filter( @@ -1259,32 +1264,37 @@ function( $networks ) { $modified_networks = $plugin->get_social_networks(); $this->assertEquals( $modified_networks, - [ - 'behance' => [ 'Behance', 'fab fa-behance' ], - 'blogger' => [ 'Blogger', 'fab fa-blogger-b' ], + array( + 'behance' => array( 'Behance', 'fab fa-behance' ), + 'blogger' => array( 'Blogger', 'fab fa-blogger-b' ), 'dev-to' => [ 'Dev.to', 'fab fa-dev' ], - 'digg' => [ 'Digg', 'fab fa-digg' ], - 'discourse' => [ 'Discourse', 'fab fa-discourse' ], - 'facebook' => [ 'Facebook', 'fab fa-facebook-f' ], - 'flickr' => [ 'Flickr', 'fab fa-flickr' ], - 'github' => [ 'GitHub', 'fab fa-github' ], - 'goodreads' => [ 'Goodreads', 'fab fa-goodreads-g' ], - 'hacker-news' => [ 'Hacker News', 'fab fa-hacker-news' ], - 'instagram' => [ 'Instagram', 'fab fa-instagram' ], - 'linkedin' => [ 'LinkedIn', 'fab fa-linkedin-in' ], - 'medium' => [ 'Medium', 'fab fa-medium-m' ], - 'meetup' => [ 'Meetup', 'fab fa-meetup' ], - 'pinterest' => [ 'Pinterest', 'fab fa-pinterest-p' ], - 'reddit' => [ 'Reddit', 'fab fa-reddit-alien' ], - 'stack-exchange' => [ 'Stack Exchange', 'fab fa-stack-exchange' ], - 'stack-overflow' => [ 'Stack Overflow', 'fab fa-stack-overflow' ], - 'tumblr' => [ 'Tumblr', 'fab fa-tumblr' ], - 'twitter' => [ 'Twitter', 'fab fa-twitter' ], - 'vimeo' => [ 'Vimeo', 'fab fa-vimeo-v' ], - 'xing' => [ 'Xing', 'fab fa-xing' ], - 'yelp' => [ 'Yelp', 'fab fa-yelp' ], - 'youtube' => [ 'YouTube', 'fab fa-youtube' ], - ] + 'digg' => array( 'Digg', 'fab fa-digg' ), + 'discourse' => array( 'Discourse', 'fab fa-discourse' ), + 'facebook' => array( 'Facebook', 'fab fa-facebook-f' ), + 'flickr' => array( 'Flickr', 'fab fa-flickr' ), + 'github' => array( 'GitHub', 'fab fa-github' ), + 'goodreads' => array( 'Goodreads', 'fab fa-goodreads-g' ), + 'hacker-news' => array( 'Hacker News', 'fab fa-hacker-news' ), + 'instagram' => array( 'Instagram', 'fab fa-instagram' ), + 'linkedin' => array( 'LinkedIn', 'fab fa-linkedin-in' ), + 'medium' => array( 'Medium', 'fab fa-medium-m' ), + 'meetup' => array( 'Meetup', 'fab fa-meetup' ), + 'odnoklassniki' => array( 'Odnoklassniki', 'fab fa-odnoklassniki'), + 'pinterest' => array( 'Pinterest', 'fab fa-pinterest-p' ), + 'reddit' => array( 'Reddit', 'fab fa-reddit-alien' ), + 'slack' => array( 'Slack', 'fab fa-slack'), + 'stack-exchange' => array( 'Stack Exchange', 'fab fa-stack-exchange' ), + 'stack-overflow' => array( 'Stack Overflow', 'fab fa-stack-overflow' ), + 'tumblr' => array( 'Tumblr', 'fab fa-tumblr' ), + 'twitter' => array( 'Twitter', 'fab fa-twitter' ), + 'vimeo' => array( 'Vimeo', 'fab fa-vimeo-v' ), + 'vk' => array( 'VK', 'fab fa-vk'), + 'weibo' => array( 'Weibo', 'fab fa-weibo'), + 'whatsapp' => array( 'WhatsApp', 'fab fa-whatsapp'), + 'xing' => array( 'Xing', 'fab fa-xing' ), + 'yelp' => array( 'Yelp', 'fab fa-yelp' ), + 'youtube' => array( 'YouTube', 'fab fa-youtube' ), + ) ); } diff --git a/_test/tests/test-shorten-bitly.php b/_test/tests/test-shorten-bitly.php index 8cb1afa..db01e06 100644 --- a/_test/tests/test-shorten-bitly.php +++ b/_test/tests/test-shorten-bitly.php @@ -62,7 +62,7 @@ function test_bitly_request() { $this->assertTrue( $shortener instanceof \UtmDotCodes\Shorten ); $this->assertEquals( null, $shortener->get_error() ); - $this->assertTrue( strpos( $shortener->get_response(), 'http://bit.ly/' ) !== false ); + $this->assertTrue( strpos( $shortener->get_response(), 'https://bit.ly/' ) !== false ); } /** diff --git a/_test/tests/test-shorten-rebrandly.php b/_test/tests/test-shorten-rebrandly.php index f7fbe81..71b4505 100644 --- a/_test/tests/test-shorten-rebrandly.php +++ b/_test/tests/test-shorten-rebrandly.php @@ -111,4 +111,32 @@ function test_rebrandly_request_no_link() { $this->assertTrue( strpos( $shortener->get_response(), 'https://rebrand.ly/' ) === false ); } + /** + * Test rebrandly domains update checkbox reset + * + * @depends test_is_test + */ + function test_rebrandly_domains_update_checkbox() { + $plugin = new UtmDotCodes(); + $value = $plugin->pre_rebrandly_domains_update('new value', 'old value', UtmDotCodes::POST_TYPE . '_rebrandly_domains_update'); + + $this->assertEquals( '', $value ); + } + + /** + * Test rebrandly domain retrieval + * + * @depends test_is_test + */ + function test_rebrandly_domains_update_options() { + $plugin = new UtmDotCodes(); + update_option( UtmDotCodes::POST_TYPE . '_shortener', 'rebrandly' ); + update_option( UtmDotCodes::POST_TYPE . '_apikey', getenv( 'UTMDC_REBRANDLY_API' ) ); + + $value = $plugin->pre_rebrandly_domains_update('on', '', UtmDotCodes::POST_TYPE . '_rebrandly_domains_update'); + $domains = json_decode( get_option( UtmDotCodes::POST_TYPE . '_rebrandly_domains' ) ); + + $this->assertGreaterThan( 0, count($domains) ); + $this->assertEquals( '', $value ); + } } diff --git a/classes/class-utmdotcodes.php b/classes/class-utmdotcodes.php index 9782ca0..12dc47c 100644 --- a/classes/class-utmdotcodes.php +++ b/classes/class-utmdotcodes.php @@ -32,35 +32,43 @@ class UtmDotCodes { public function __construct() { global $pagenow; + require_once 'shorten/interface.php'; + remove_post_type_support( self::POST_TYPE, 'revisions' ); - add_action( 'plugins_loaded', [ &$this, 'load_languages' ] ); - add_action( 'init', [ &$this, 'create_post_type' ] ); - add_action( 'admin_menu', [ &$this, 'add_settings_page' ] ); - add_action( 'admin_init', [ &$this, 'register_plugin_settings' ] ); - add_action( 'admin_head', [ &$this, 'add_css' ] ); - add_action( 'admin_footer', [ &$this, 'add_js' ] ); - add_action( 'add_meta_boxes', [ &$this, 'add_meta_box' ], 10, 2 ); - add_action( 'add_meta_boxes', [ &$this, 'remove_meta_boxes' ] ); - add_action( 'save_post', [ &$this, 'save_post' ], 10, 1 ); - add_action( 'dashboard_glance_items', [ &$this, 'add_glance' ] ); - add_action( 'wp_ajax_utmdc_check_url_response', [ &$this, 'check_url_response' ] ); - - add_filter( 'plugin_action_links_' . UTMDC_PLUGIN_FILE, [ &$this, 'add_links' ], 10, 1 ); - add_filter( 'wp_insert_post_data', [ &$this, 'insert_post_data' ], 10, 2 ); - add_filter( 'gettext', [ &$this, 'change_publish_button' ], 10, 2 ); + add_action( 'plugins_loaded', array( &$this, 'load_languages' ) ); + add_action( 'init', array( &$this, 'create_post_type' ) ); + add_action( 'admin_menu', array( &$this, 'add_settings_page' ) ); + add_action( 'admin_init', array( &$this, 'register_plugin_settings' ) ); + add_action( 'admin_head', array( &$this, 'add_css' ) ); + add_action( 'admin_footer', array( &$this, 'add_js' ) ); + add_action( 'add_meta_boxes', array( &$this, 'add_meta_box' ), 10, 2 ); + add_action( 'add_meta_boxes', array( &$this, 'remove_meta_boxes' ) ); + add_action( 'save_post', array( &$this, 'save_post' ), 10, 1 ); + add_action( 'dashboard_glance_items', array( &$this, 'add_glance' ) ); + add_action( 'wp_ajax_utmdc_check_url_response', array( &$this, 'check_url_response' ) ); + + add_filter( 'plugin_action_links_' . UTMDC_PLUGIN_FILE, array( &$this, 'add_links' ), 10, 1 ); + add_filter( 'wp_insert_post_data', array( &$this, 'insert_post_data' ), 10, 2 ); + add_filter( 'gettext', array( &$this, 'change_publish_button' ), 10, 2 ); + add_filter( + sprintf( 'pre_update_option_%s', self::POST_TYPE . '_rebrandly_domains_update' ), + array( &$this, 'pre_rebrandly_domains_update' ), + 10, + 3 + ); $is_post_list = ( 'edit.php' === $pagenow ); $is_utmdc_post = ( self::POST_TYPE === filter_input( INPUT_GET, 'post_type', FILTER_SANITIZE_STRING ) ); if ( ( is_admin() && $is_post_list && $is_utmdc_post ) || $this->is_test() ) { - add_action( 'restrict_manage_posts', [ &$this, 'filter_ui' ], 5, 1 ); - add_action( 'pre_get_posts', [ &$this, 'apply_filters' ], 5, 1 ); - add_filter( 'manage_' . self::POST_TYPE . '_posts_columns', [ &$this, 'post_list_header' ], 10, 1 ); - add_filter( 'manage_' . self::POST_TYPE . '_posts_custom_column', [ &$this, 'post_list_columns' ], 10, 2 ); - add_filter( 'months_dropdown_results', [ &$this, 'months_dropdown_results' ], 10, 2 ); - add_filter( 'bulk_actions-edit-' . self::POST_TYPE, [ &$this, 'bulk_actions' ] ); - add_filter( 'post_row_actions', [ &$this, 'remove_quick_edit' ], 10, 1 ); + add_action( 'restrict_manage_posts', array( &$this, 'filter_ui' ), 5, 1 ); + add_action( 'pre_get_posts', array( &$this, 'apply_filters' ), 5, 1 ); + add_filter( 'manage_' . self::POST_TYPE . '_posts_columns', array( &$this, 'post_list_header' ), 10, 1 ); + add_filter( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( &$this, 'post_list_columns' ), 10, 2 ); + add_filter( 'months_dropdown_results', array( &$this, 'months_dropdown_results' ), 10, 2 ); + add_filter( 'bulk_actions-edit-' . self::POST_TYPE, array( &$this, 'bulk_actions' ) ); + add_filter( 'post_row_actions', array( &$this, 'remove_quick_edit' ), 10, 1 ); } } @@ -70,62 +78,62 @@ public function __construct() { * @since 1.0.0 */ public function create_post_type() { - $this->link_elements = [ - 'url' => [ + $this->link_elements = array( + 'url' => array( 'label' => esc_html_x( 'Link URL', 'utm-dot-codes' ), 'short_label' => esc_html_x( 'URL', 'utm-dot-codes' ), 'type' => 'url', 'required' => true, 'batch_alt' => true, - ], - 'source' => [ + ), + 'source' => array( 'label' => esc_html_x( 'Campaign Source', 'utm-dot-codes' ), 'short_label' => esc_html_x( 'Source', 'utm-dot-codes' ), 'type' => 'text', 'required' => true, 'batch_alt' => true, - ], - 'medium' => [ + ), + 'medium' => array( 'label' => esc_html_x( 'Campaign Medium', 'utm-dot-codes' ), 'short_label' => esc_html_x( 'Medium', 'utm-dot-codes' ), 'type' => 'text', 'required' => false, 'batch_alt' => true, - ], - 'campaign' => [ + ), + 'campaign' => array( 'label' => esc_html_x( 'Campaign Name', 'utm-dot-codes' ), 'short_label' => esc_html_x( 'Campaign', 'utm-dot-codes' ), 'type' => 'text', 'required' => false, 'batch_alt' => false, - ], - 'term' => [ + ), + 'term' => array( 'label' => esc_html_x( 'Campaign Term', 'utm-dot-codes' ), 'short_label' => esc_html_x( 'Term', 'utm-dot-codes' ), 'type' => 'text', 'required' => false, 'batch_alt' => false, - ], - 'content' => [ + ), + 'content' => array( 'label' => esc_html_x( 'Campaign Content', 'utm-dot-codes' ), 'short_label' => esc_html_x( 'Content', 'utm-dot-codes' ), 'type' => 'text', 'required' => false, 'batch_alt' => false, - ], - 'shorturl' => [ + ), + 'shorturl' => array( 'label' => esc_html_x( 'Short URL', 'utm-dot-codes' ), 'short_label' => esc_html_x( 'Short URL', 'utm-dot-codes' ), 'type' => 'url', 'required' => false, 'batch_alt' => false, - ], - ]; + ), + ); register_post_type( self::POST_TYPE, - [ - 'labels' => [ + array( + 'labels' => array( 'menu_name' => _x( 'utm.codes', 'admin menu', 'utm-dot-codes' ), 'name' => _x( 'Marketing Links', 'post type general name', 'utm-dot-codes' ), 'singular_name' => _x( 'Marketing Link', 'post type singular name', 'utm-dot-codes' ), @@ -140,7 +148,8 @@ public function create_post_type() { 'parent_item_colon' => __( 'Parent Link:', 'utm-dot-codes' ), 'not_found' => __( 'No marketing links found.', 'utm-dot-codes' ), 'not_found_in_trash' => __( 'No marketing links found in Trash.', 'utm-dot-codes' ), - ], + 'featured_image' => __( 'Featured Image', 'utm-dot-codes' ), + ), 'description' => __( 'utm.codes Marketing Links', 'utm-dot-codes' ), 'public' => false, 'publicly_queryable' => false, @@ -150,17 +159,17 @@ public function create_post_type() { 'capability_type' => 'post', 'has_archive' => false, 'hierarchical' => false, - 'supports' => [ 'author' ], - 'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode( '' ), - ] + 'supports' => array( 'author' ), + 'menu_icon' => 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yMi4yMjIyMjIyMjIyMjIyMjUgLTIyLjIyMjIyMjIyMjIyMjIyNSAxNDQuNDQ0NDQ0NDQ0NDQ0NDYgMTU1LjU1NTU1NTU1NTU1NTU3IiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTYuNjY2NjY2NjY2NjY2NjY0IC0xMS4xMTExMTExMTExMTExMSkgc2NhbGUoNS41NTU1NTU1NTU1NTU1NTUpIj48ZyBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTUgMmMtMS42IDAtMy4xLjctNC4yIDEuNy44LjIgMS41LjUgMi4xLjkuNi0uNCAxLjMtLjYgMi4xLS42IDIuMiAwIDQgMS44IDQgNHY1YzAgMi4yLTEuOCA0LTQgNHMtNC0xLjgtNC00VjkuNWMtLjUtLjYtMS4yLTEtMi0xVjEzYzAgMy4zIDIuNyA2IDYgNnM2LTIuNyA2LTZWOGMwLTMuMy0yLjctNi02LTZ6Ij48L3BhdGg+PHBhdGggZD0iTTkgMjJjMS42IDAgMy4xLS43IDQuMi0xLjctLjgtLjItMS41LS41LTIuMS0uOS0uNi40LTEuMy42LTIuMS42LTIuMiAwLTQtMS44LTQtNHYtNWMwLTIuMiAxLjgtNCA0LTRzNCAxLjggNCA0djMuNWMuNS42IDEuMiAxIDIgMVYxMWMwLTMuMy0yLjctNi02LTZzLTYgMi43LTYgNnY1YzAgMy4zIDIuNyA2IDYgNnoiPjwvcGF0aD48L2c+PC9nPjwvc3ZnPg==', + ) ); if ( 'on' === get_option( self::POST_TYPE . '_labels' ) ) { register_taxonomy( self::POST_TYPE . '-label', - [ self::POST_TYPE ], - [ - 'labels' => [ + array( self::POST_TYPE ), + array( + 'labels' => array( 'name' => _x( 'Link Labels', 'Taxonomy General Name', 'utm-dot-codes' ), 'singular_name' => _x( 'Link Label', 'Taxonomy Singular Name', 'utm-dot-codes' ), 'menu_name' => __( 'Link Labels', 'utm-dot-codes' ), @@ -178,7 +187,7 @@ public function create_post_type() { 'no_terms' => __( 'No labels', 'utm-dot-codes' ), 'items_list' => __( 'Labels list', 'utm-dot-codes' ), 'items_list_navigation' => __( 'Labels list navigation', 'utm-dot-codes' ), - ], + ), 'hierarchical' => false, 'public' => false, 'publicly_queryable' => false, @@ -187,7 +196,7 @@ public function create_post_type() { 'show_in_nav_menus' => false, 'show_in_rest' => false, 'show_tagcloud' => true, - ] + ) ); } } @@ -201,7 +210,7 @@ public function add_meta_box() { add_meta_box( 'utmdc_link_meta_box', 'utm.codes Editor', - [ &$this, 'meta_box_contents' ], + array( &$this, 'meta_box_contents' ), self::POST_TYPE, 'normal', 'high' @@ -225,9 +234,7 @@ public function remove_meta_boxes() { public function meta_box_contents() { global $post; - require_once 'shorten/interface.php'; - - $contents = []; + $contents = array(); if ( isset( $_GET['utmdc-error'] ) ) { $error = $this->get_error_message( intval( $_GET['utmdc-error'] ) ); @@ -309,7 +316,7 @@ function( $key, $entry ) use ( $post ) { ); $contents[] = sprintf( - '

', + '

', self::POST_TYPE, 'notes', esc_html__( 'Notes', 'utm-dot-codes' ), @@ -348,7 +355,7 @@ public function add_settings_page() { esc_html__( 'utm.codes', 'utm-dot-codes' ), 'manage_options', self::SETTINGS_PAGE, - [ &$this, 'render_settings_options' ] + array( &$this, 'render_settings_options' ) ); } @@ -431,7 +438,7 @@ public function render_settings_options() {

%s', + '%s %s', esc_html__( 'Adding your own custom link formatting is easy with an API filter.', 'utm-dot-codes' ), esc_html__( 'Visit our wiki for examples and to find out more.', 'utm-dot-codes' ) ); @@ -522,7 +529,7 @@ function( $key, $value ) use ( $active_networks ) {

%s', + '%s %s', esc_html__( 'Adding your own custom network options is easy with an API filter.', 'utm-dot-codes' ), esc_html__( 'Visit our wiki for examples and to find out more.', 'utm-dot-codes' ) ); @@ -561,7 +568,7 @@ function ( $value ) use ( $active_shortener ) { esc_html( $value ) ); }, - [ 'None', 'Bitly', 'Rebrandly' ] + array( 'None', 'Bitly', 'Rebrandly' ) ); print( '' ); @@ -574,7 +581,7 @@ function ( $value ) use ( $active_shortener ) { ?> - + @@ -587,18 +594,69 @@ function ( $value ) use ( $active_shortener ) { ); printf( - '
[ %s %s ]', - esc_html__( 'Questions?', 'utm-dot-codes' ), + '
[ %s %s ]', + esc_html__( 'API Questions?', 'utm-dot-codes' ), esc_html__( 'Click here for more additional details.', 'utm-dot-codes' ) ); ?> + + + + + + '', + 'full_name' => 'rebrand.ly', + ), + ), + is_array( $rebrandly_domains ) ? $rebrandly_domains : array() + ); + + printf( + '', + esc_html( self::POST_TYPE . '_rebrandly_domains' ), + esc_html( wp_json_encode( $rebrandly_domains ) ) + ); + + printf( + '' ); + + printf( + '', + esc_html( self::POST_TYPE . '_rebrandly_domains_update' ), + esc_html__( 'Update Options from Rebrandly.', 'utm-dot-codes' ) + ); + ?> + +

%s', + '%s %s', esc_html__( 'Adding your own custom link shortener is easy.', 'utm-dot-codes' ), esc_html__( 'Visit our wiki for examples and to find out more.', 'utm-dot-codes' ) ); @@ -626,6 +684,9 @@ public function register_plugin_settings() { register_setting( self::SETTINGS_GROUP, self::POST_TYPE . '_notes_show' ); register_setting( self::SETTINGS_GROUP, self::POST_TYPE . '_notes_preview' ); register_setting( self::SETTINGS_GROUP, self::POST_TYPE . '_shortener' ); + register_setting( self::SETTINGS_GROUP, self::POST_TYPE . '_rebrandly_domains' ); + register_setting( self::SETTINGS_GROUP, self::POST_TYPE . '_rebrandly_domains_active' ); + register_setting( self::SETTINGS_GROUP, self::POST_TYPE . '_rebrandly_domains_update' ); } /** @@ -639,7 +700,7 @@ public function register_plugin_settings() { */ public function add_links( $links ) { return array_merge( - [ + array( sprintf( '%s', esc_url( admin_url( 'options-general.php?page=' . self::SETTINGS_PAGE ) ), @@ -649,7 +710,7 @@ public function add_links( $links ) { '%s', esc_html__( 'Code', 'utm-dot-codes' ) ), - ], + ), $links ); } @@ -701,7 +762,7 @@ function( $location ) { $_POST[ self::POST_TYPE . '_medium' ] = esc_html__( 'social', 'utm-dot-codes' ); unset( $networks[0] ); - $post_template = []; + $post_template = array(); array_map( function( $key ) use ( &$post_template ) { @@ -712,14 +773,14 @@ function( $key ) use ( &$post_template ) { array_keys( $this->link_elements ) ); - remove_action( 'save_post', [ &$this, 'save_post' ] ); + remove_action( 'save_post', array( &$this, 'save_post' ) ); array_map( function( $network ) { - $meta_input = [ + $meta_input = array( self::POST_TYPE . '_source' => $network, self::POST_TYPE . '_medium' => esc_html__( 'social', 'utm-dot-codes' ), - ]; + ); if ( isset( $_POST[ self::POST_TYPE . '_url' ] ) ) { $meta_input[ self::POST_TYPE . '_url' ] = $this->sanitize_url( @@ -748,13 +809,13 @@ function( $network ) { ); } - $new_post = [ + $new_post = array( 'post_title' => '', 'post_content' => '', 'post_type' => self::POST_TYPE, 'post_status' => 'publish', 'meta_input' => $meta_input, - ]; + ); if ( isset( $_POST[ self::POST_TYPE . '_shorten' ] ) ) { if ( 'on' === sanitize_text_field( wp_unslash( $_POST[ self::POST_TYPE . '_shorten' ] ) ) ) { @@ -790,7 +851,7 @@ function( $network ) { $networks ); - add_action( 'save_post', [ &$this, 'save_post' ], 10, 1 ); + add_action( 'save_post', array( &$this, 'save_post' ), 10, 1 ); } if ( isset( $_POST[ self::POST_TYPE . '_shorten' ] ) && 'on' === $_POST[ self::POST_TYPE . '_shorten' ] ) { @@ -803,11 +864,11 @@ function( $key ) { $post_id = absint( $_POST['ID'] ); $current = get_post_meta( $post_id, $field, true ); $updated = ''; - $do_not_filter = [ + $do_not_filter = array( self::POST_TYPE . '_url', self::POST_TYPE . '_shorturl', self::POST_TYPE . '_notes', - ]; + ); if ( isset( $_POST[ $field ] ) ) { if ( self::POST_TYPE . '_notes' === $field ) { @@ -829,7 +890,7 @@ function( $key ) { }, array_merge( array_keys( $this->link_elements ), - [ 'notes' ] + array( 'notes' ) ) ); @@ -888,7 +949,7 @@ public function generate_query_string( $data, $url ) { } $params_array = array_filter( - [ + array( 'utm_source' => $this->filter_link_element( 'utm_source', $data[ self::POST_TYPE . '_source' ] @@ -910,7 +971,7 @@ public function generate_query_string( $data, $url ) { $data[ self::POST_TYPE . '_content' ] ), 'utm_gen' => 'utmdc', - ] + ) ); return ( strpos( $url, '?' ) ? '&' : '?' ) . http_build_query( $params_array ); @@ -945,7 +1006,8 @@ public function generate_short_url( $data, $url ) { case 'rebrandly': require_once 'shorten/class-rebrandly.php'; $shortener = new \UtmDotCodes\Rebrandly( - get_option( self::POST_TYPE . '_apikey' ) + get_option( self::POST_TYPE . '_apikey' ), + get_option( self::POST_TYPE . '_rebrandly_domains_active' ) ); break; @@ -1005,7 +1067,7 @@ public function post_list_header( $columns ) { unset( $columns['author'] ); $columns = array_merge( - [ + array( 'cb' => '', 'utmdc_link' => esc_html__( 'Link', 'utm-dot-codes' ), 'utmdc_source' => esc_html__( 'Source', 'utm-dot-codes' ), @@ -1015,7 +1077,7 @@ public function post_list_header( $columns ) { 'utmdc_content' => esc_html__( 'Content', 'utm-dot-codes' ), 'utmdc_notes' => esc_html__( 'Notes', 'utm-dot-codes' ), 'copy_utmdc_link' => esc_html__( 'Copy Links', 'utm-dot-codes' ), - ], + ), $columns ); @@ -1117,11 +1179,11 @@ function( $filter ) { $sanitized_filter_value = sanitize_text_field( wp_unslash( $filter_value ) ); if ( ! empty( $sanitized_filter_value ) ) { - return [ + return array( 'key' => $filter_name, 'value' => $sanitized_filter_value, 'compare' => '=', - ]; + ); } }, $filters @@ -1214,10 +1276,10 @@ function ( $value ) use ( $key ) { if ( 'on' === get_option( self::POST_TYPE . '_labels' ) ) { $terms = get_terms( - [ + array( 'taxonomy' => self::POST_TYPE . '-label', 'hide_empty' => true, - ] + ) ); $term_options = array_map( @@ -1285,14 +1347,14 @@ public function add_css() { wp_enqueue_style( 'font-awesome', 'https://use.fontawesome.com/releases/v5.7.2/css/all.css', - [], + array(), UTMDC_VERSION, 'all' ); wp_enqueue_style( 'utm-dot-codes', UTMDC_PLUGIN_URL . 'css/utmdotcodes.min.css', - [ 'font-awesome' ], + array( 'font-awesome' ), hash_file( 'sha1', UTMDC_PLUGIN_DIR . 'css/utmdotcodes.min.css' ), 'all' ); @@ -1307,7 +1369,7 @@ public function add_js() { wp_enqueue_script( 'utm-dot-codes', UTMDC_PLUGIN_URL . 'js/utmdotcodes.min.js', - [ 'jquery' ], + array( 'jquery' ), hash_file( 'sha1', UTMDC_PLUGIN_DIR . 'js/utmdotcodes.min.js' ), 'all' ); @@ -1315,9 +1377,9 @@ public function add_js() { wp_localize_script( 'utm-dot-codes', 'utmdcRestApi', - [ + array( 'actionKey' => wp_create_nonce( self::REST_NONCE_LABEL ), - ] + ) ); } @@ -1487,10 +1549,10 @@ public function filter_link_element( $element, $value ) { * @since 1.2.0 */ public function check_url_response() { - $response = [ + $response = array( 'message' => 'Could not process request.', 'status' => 500, - ]; + ); if ( check_ajax_referer( self::REST_NONCE_LABEL, 'key', false ) ) { if ( isset( $_REQUEST['action'] ) && 'utmdc_check_url_response' === sanitize_text_field( wp_unslash( $_REQUEST['action'] ) ) ) { @@ -1504,9 +1566,9 @@ public function check_url_response() { $is_valid_url = ( filter_var( $request_url, FILTER_VALIDATE_URL ) === $request_url ); if ( $is_valid_referer && $is_valid_url ) { - $args = []; + $args = array(); if ( $this->is_test() ) { - $args = [ 'sslverify' => false ]; + $args = array( 'sslverify' => false ); } $url_check = wp_remote_get( $request_url, $args ); @@ -1554,7 +1616,7 @@ function( $element ) { public function months_dropdown_results( $months, $post_type ) { if ( self::POST_TYPE === $post_type ) { - $months = []; + $months = array(); } return $months; @@ -1570,32 +1632,37 @@ public function months_dropdown_results( $months, $post_type ) { public function get_social_networks() { $networks = apply_filters( 'utmdc_social_sources', - [ - 'behance' => [ 'Behance', 'fab fa-behance' ], - 'blogger' => [ 'Blogger', 'fab fa-blogger-b' ], - 'digg' => [ 'Digg', 'fab fa-digg' ], - 'discourse' => [ 'Discourse', 'fab fa-discourse' ], - 'facebook' => [ 'Facebook', 'fab fa-facebook-f' ], - 'flickr' => [ 'Flickr', 'fab fa-flickr' ], - 'github' => [ 'GitHub', 'fab fa-github' ], - 'goodreads' => [ 'Goodreads', 'fab fa-goodreads-g' ], - 'hacker-news' => [ 'Hacker News', 'fab fa-hacker-news' ], - 'instagram' => [ 'Instagram', 'fab fa-instagram' ], - 'linkedin' => [ 'LinkedIn', 'fab fa-linkedin-in' ], - 'medium' => [ 'Medium', 'fab fa-medium-m' ], - 'meetup' => [ 'Meetup', 'fab fa-meetup' ], - 'mix' => [ 'Mix', 'fab fa-mix' ], - 'pinterest' => [ 'Pinterest', 'fab fa-pinterest-p' ], - 'reddit' => [ 'Reddit', 'fab fa-reddit-alien' ], - 'stack-exchange' => [ 'Stack Exchange', 'fab fa-stack-exchange' ], - 'stack-overflow' => [ 'Stack Overflow', 'fab fa-stack-overflow' ], - 'tumblr' => [ 'Tumblr', 'fab fa-tumblr' ], - 'twitter' => [ 'Twitter', 'fab fa-twitter' ], - 'vimeo' => [ 'Vimeo', 'fab fa-vimeo-v' ], - 'xing' => [ 'Xing', 'fab fa-xing' ], - 'yelp' => [ 'Yelp', 'fab fa-yelp' ], - 'youtube' => [ 'YouTube', 'fab fa-youtube' ], - ] + array( + 'behance' => array( 'Behance', 'fab fa-behance' ), + 'blogger' => array( 'Blogger', 'fab fa-blogger-b' ), + 'digg' => array( 'Digg', 'fab fa-digg' ), + 'discourse' => array( 'Discourse', 'fab fa-discourse' ), + 'facebook' => array( 'Facebook', 'fab fa-facebook-f' ), + 'flickr' => array( 'Flickr', 'fab fa-flickr' ), + 'github' => array( 'GitHub', 'fab fa-github' ), + 'goodreads' => array( 'Goodreads', 'fab fa-goodreads-g' ), + 'hacker-news' => array( 'Hacker News', 'fab fa-hacker-news' ), + 'instagram' => array( 'Instagram', 'fab fa-instagram' ), + 'linkedin' => array( 'LinkedIn', 'fab fa-linkedin-in' ), + 'medium' => array( 'Medium', 'fab fa-medium-m' ), + 'meetup' => array( 'Meetup', 'fab fa-meetup' ), + 'mix' => array( 'Mix', 'fab fa-mix' ), + 'odnoklassniki' => array( 'Odnoklassniki', 'fab fa-odnoklassniki' ), + 'pinterest' => array( 'Pinterest', 'fab fa-pinterest-p' ), + 'reddit' => array( 'Reddit', 'fab fa-reddit-alien' ), + 'slack' => array( 'Slack', 'fab fa-slack' ), + 'stack-exchange' => array( 'Stack Exchange', 'fab fa-stack-exchange' ), + 'stack-overflow' => array( 'Stack Overflow', 'fab fa-stack-overflow' ), + 'tumblr' => array( 'Tumblr', 'fab fa-tumblr' ), + 'twitter' => array( 'Twitter', 'fab fa-twitter' ), + 'vimeo' => array( 'Vimeo', 'fab fa-vimeo-v' ), + 'vk' => array( 'VK', 'fab fa-vk' ), + 'weibo' => array( 'Weibo', 'fab fa-weibo' ), + 'whatsapp' => array( 'WhatsApp', 'fab fa-whatsapp' ), + 'xing' => array( 'Xing', 'fab fa-xing' ), + 'yelp' => array( 'Yelp', 'fab fa-yelp' ), + 'youtube' => array( 'YouTube', 'fab fa-youtube' ), + ) ); ksort( $networks ); @@ -1667,15 +1734,17 @@ public function change_publish_button( $translation, $text ) { /** * Retrieve error message for output based on provided error code. * + * @since 1.6.0 + * * @param integer $error_code numeric value to convert to message. * * @return array error message elements: style & message text. */ public function get_error_message( $error_code ) { - $error_message = [ + $error_message = array( 'style' => '', 'message' => '', - ]; + ); switch ( $error_code ) { /** @@ -1684,67 +1753,102 @@ public function get_error_message( $error_code ) { // Invalid URL String. case 1: - $error_message = [ + $error_message = array( 'style' => 'notice-warning', 'message' => esc_html__( 'Invalid URL format. Replaced with site URL. Please update as needed.', 'utm-dot-codes' ), - ]; + ); break; // Invalid Post ID. case 2: - $error_message = [ + $error_message = array( 'style' => 'notice-error', 'message' => esc_html__( 'Unable to save link. Please try again, your changes were not saved.', 'utm-dot-codes' ), - ]; + ); break; // Shortener Object Error. case 1000: - $error_message = [ + $error_message = array( 'style' => 'notice-error', 'message' => esc_html__( 'Invalid URL shortener config.', 'utm-dot-codes' ), - ]; + ); break; /** * Bitly */ case 100: - $error_message = [ + $error_message = array( 'style' => 'notice-error', 'message' => esc_html__( 'Unable to connect to Bitly API to shorten url. Please try again later.', 'utm-dot-codes' ), - ]; + ); break; case 4030: - $error_message = [ + $error_message = array( 'style' => 'notice-error', 'message' => esc_html__( 'Bitly API responded with unauthorized error. API Key is invalid or rate limit exceeded.', 'utm-dot-codes' ), - ]; + ); break; case 500: - $error_message = [ + $error_message = array( 'style' => 'notice-error', 'message' => esc_html__( 'Bitly API experienced an error when shortening the link, please try again later.', 'utm-dot-codes' ), - ]; + ); break; /** * Rebrandly */ case 401: - $error_message = [ + $error_message = array( 'style' => 'notice-error', 'message' => esc_html__( 'Rebrandly API responded with unauthorized error. API Key is invalid or rate limit exceeded.', 'utm-dot-codes' ), - ]; + ); break; case 4031: - $error_message = [ + $error_message = array( 'style' => 'notice-error', 'message' => esc_html__( 'Rebrandly API experienced an error when shortening the link, please try again later.', 'utm-dot-codes' ), - ]; + ); break; } return apply_filters( 'utmdc_error_message', $error_message, $error_code ); } + + /** + * Retrieve updated list of domain options when requested by the user. + * + * @since 1.7.0 + * + * @param mixed $value The new value. + * @param mixed $old_value The old value. + * @param string $option The option being updated. + * + * @return string Empty string to ensure the checkbox remains unchecked. + */ + public function pre_rebrandly_domains_update( $value, $old_value, $option ) { + $update_setting = ( self::POST_TYPE . '_rebrandly_domains_update' === $option ); + $update_requested = ( 'on' === $value ); + + if ( $update_setting && $update_requested ) { + if ( 'rebrandly' === get_option( self::POST_TYPE . '_shortener' ) ) { + require_once 'shorten/class-rebrandly.php'; + + $rebrandly = new \UtmDotCodes\Rebrandly( get_option( self::POST_TYPE . '_apikey' ) ); + $options = $rebrandly->get_domains(); + + if ( is_array( $options ) && 0 < count( $options ) ) { + update_option( + self::POST_TYPE . '_rebrandly_domains', + wp_json_encode( $options ), + false + ); + } + } + } + + return ''; + } } diff --git a/classes/class-utmdotcodesactivation.php b/classes/class-utmdotcodesactivation.php index 8e91e0b..e226109 100644 --- a/classes/class-utmdotcodesactivation.php +++ b/classes/class-utmdotcodesactivation.php @@ -18,8 +18,8 @@ class UtmDotCodesActivation { * @since 1.0 */ public function __construct() { - register_activation_hook( UTMDC_PLUGIN_FILE, [ &$this, 'activation' ] ); - register_deactivation_hook( UTMDC_PLUGIN_FILE, [ &$this, 'deactivation' ] ); + register_activation_hook( UTMDC_PLUGIN_FILE, array( &$this, 'activation' ) ); + register_deactivation_hook( UTMDC_PLUGIN_FILE, array( &$this, 'deactivation' ) ); } /** @@ -66,6 +66,9 @@ public function activation() { add_option( UtmDotCodes::POST_TYPE . '_notes_show', '', '', 'no' ); add_option( UtmDotCodes::POST_TYPE . '_notes_preview', '0', '', 'no' ); add_option( UtmDotCodes::POST_TYPE . '_shortener', 'none', '', 'no' ); + add_option( UtmDotCodes::POST_TYPE . '_rebrandly_domains', '', '', 'no' ); + add_option( UtmDotCodes::POST_TYPE . '_rebrandly_domains_active', '', '', 'no' ); + add_option( UtmDotCodes::POST_TYPE . '_rebrandly_domains_update', '', '', 'no' ); } /** @@ -88,6 +91,9 @@ public function deactivation() { delete_option( UtmDotCodes::POST_TYPE . '_notes_show' ); delete_option( UtmDotCodes::POST_TYPE . '_notes_preview' ); delete_option( UtmDotCodes::POST_TYPE . '_shortener' ); + delete_option( UtmDotCodes::POST_TYPE . '_rebrandly_domains' ); + delete_option( UtmDotCodes::POST_TYPE . '_rebrandly_domains_active' ); + delete_option( UtmDotCodes::POST_TYPE . '_rebrandly_domains_update' ); } } diff --git a/classes/shorten/class-bitly.php b/classes/shorten/class-bitly.php index e15cfdb..fff263c 100644 --- a/classes/shorten/class-bitly.php +++ b/classes/shorten/class-bitly.php @@ -63,18 +63,18 @@ public function shorten( $data, $query_string ) { $response = wp_remote_post( self::API_URL . '/shorten', // Selective overrides of WP_Http() defaults. - [ + array( 'method' => 'POST', 'timeout' => 15, 'redirection' => 5, 'httpversion' => '1.1', 'blocking' => true, - 'headers' => [ + 'headers' => array( 'Authorization' => 'Bearer ' . $this->api_key, 'Content-Type' => 'application/json', - ], - 'body' => wp_json_encode( [ 'long_url' => $data['utmdclink_url'] . $query_string ] ), - ] + ), + 'body' => wp_json_encode( array( 'long_url' => $data['utmdclink_url'] . $query_string ) ), + ) ); if ( isset( $response->errors ) ) { diff --git a/classes/shorten/class-rebrandly.php b/classes/shorten/class-rebrandly.php index 4822a63..864dcb3 100644 --- a/classes/shorten/class-rebrandly.php +++ b/classes/shorten/class-rebrandly.php @@ -35,13 +35,22 @@ class Rebrandly implements \UtmDotCodes\Shorten { */ private $error_code; + /** + * Shorten domain id to use for shortened link. + * + * @var string|null Rebrandly domain ID for the shortened link. + */ + private $short_domain_id; + /** * Rebrandly constructor. * * @param string $api_key Credentials for API. + * @param null $short_domain_id ID of the custom domain to use when shortening. */ - public function __construct( $api_key ) { - $this->api_key = $api_key; + public function __construct( $api_key, $short_domain_id = null ) { + $this->api_key = $api_key; + $this->short_domain_id = $short_domain_id; } /** @@ -60,22 +69,35 @@ public function shorten( $data, $query_string ) { } if ( '' !== $this->api_key ) { + $domain_args = array(); + + if ( ! empty( $this->short_domain_id ) ) { + $domain_args = array( + 'id' => esc_html( $this->short_domain_id ), + 'ref' => printf( '/domains/%s', esc_html( $this->short_domain_id ) ), + ); + } $response = wp_remote_post( self::API_URL . '/links', // Selective overrides of WP_Http() defaults. - [ + array( 'method' => 'POST', 'timeout' => 15, 'redirection' => 5, 'httpversion' => '1.1', 'blocking' => true, - 'headers' => [ + 'headers' => array( 'apikey' => $this->api_key, 'Content-Type' => 'application/json', - ], - 'body' => wp_json_encode( [ 'destination' => $data['utmdclink_url'] . $query_string ] ), - ] + ), + 'body' => wp_json_encode( + array( + 'destination' => $data['utmdclink_url'] . $query_string, + 'domain' => $domain_args, + ) + ), + ) ); if ( isset( $response->errors ) ) { @@ -106,6 +128,60 @@ public function shorten( $data, $query_string ) { } } + /** + * Get available custom domain options. + * + * @return array array of domain options + */ + public function get_domains() { + $domains = array(); + + if ( '' !== $this->api_key ) { + + $response = wp_remote_get( + self::API_URL . '/domains?' . http_build_query( + array( + 'orderBy' => 'fullName', + 'orderDir' => 'desc', + 'limit' => 50, + 'active' => 'true', + 'type' => 'user', + ) + ), + // Selective overrides of WP_Http() defaults. + array( + 'timeout' => 15, + 'redirection' => 5, + 'httpversion' => '1.1', + 'blocking' => true, + 'headers' => array( + 'apikey' => $this->api_key, + 'Content-Type' => 'application/json', + ), + ) + ); + + if ( ! isset( $response->errors ) ) { + $domains = array_map( + function( $domain ) { + $is_active = $domain->active; + $dns_verified = ( 'verified' === $domain->status->dns ); + + if ( $is_active && $dns_verified ) { + return array( + 'id' => $domain->id, + 'full_name' => $domain->fullName, + ); + } + }, + json_decode( $response['body'] ) + ); + } + } + + return $domains; + } + /** * Get response from Rebrandly API for the request. * diff --git a/composer.json b/composer.json index d6dec65..67f8a32 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,13 @@ { "name": "asdfdotdev/utm.codes", - "version": "1.6.3", - "description": "Easily create and manage your marketing tracking links in WordPress for better analytics.", + "version": "1.7.0", + "description": "A plugin that makes building analytics friendly links quick and easy.", "type": "wordpress-plugin", "require-dev": { - "squizlabs/php_codesniffer": "^3.4", - "wp-coding-standards/wpcs": "2.1", - "phpcompatibility/php-compatibility": "^9.1", - "dealerdirect/phpcodesniffer-composer-installer": "^0.5", + "squizlabs/php_codesniffer": "^3.5", + "wp-coding-standards/wpcs": "2.2", + "phpcompatibility/php-compatibility": "^9.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.6", "phpunit/phpunit": "^7.5" }, "license": "GPL-2.0-only", @@ -18,5 +18,5 @@ } ], "minimum-stability": "stable", - "keywords": ["WordPress", "plugin", "utm codes"] + "keywords": ["WordPress", "plugin", "utm codes", "analytics", "link builder"] } diff --git a/composer.lock b/composer.lock index bc6772e..b035e49 100644 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cfede7c0f5a3304ab7384682c80eaf8d", + "content-hash": "168fdc421eb02e6168f9785dbb27e839", "packages": [], "packages-dev": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.5.0", + "version": "v0.6.2", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "e749410375ff6fb7a040a68878c656c2e610b132" + "reference": "8001af8eb107fbfcedc31a8b51e20b07d85b457a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132", - "reference": "e749410375ff6fb7a040a68878c656c2e610b132", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/8001af8eb107fbfcedc31a8b51e20b07d85b457a", + "reference": "8001af8eb107fbfcedc31a8b51e20b07d85b457a", "shasum": "" }, "require": { @@ -71,7 +71,7 @@ "stylecheck", "tests" ], - "time": "2018-10-26T13:21:45+00:00" + "time": "2020-01-29T20:22:20+00:00" }, { "name": "doctrine/instantiator", @@ -131,16 +131,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.9.3", + "version": "1.9.5", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", "shasum": "" }, "require": { @@ -175,7 +175,7 @@ "object", "object graph" ], - "time": "2019-08-09T12:45:53+00:00" + "time": "2020-01-17T21:11:47+00:00" }, { "name": "phar-io/manifest", @@ -281,16 +281,16 @@ }, { "name": "phpcompatibility/php-compatibility", - "version": "9.3.4", + "version": "9.3.5", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "1f37659196e4f3113ea506a7efba201c52303bf1" + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/1f37659196e4f3113ea506a7efba201c52303bf1", - "reference": "1f37659196e4f3113ea506a7efba201c52303bf1", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", "shasum": "" }, "require": { @@ -335,7 +335,7 @@ "phpcs", "standards" ], - "time": "2019-11-15T04:12:02+00:00" + "time": "2019-12-27T09:44:58+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -391,40 +391,38 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.2", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", - "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", - "webmozart/assert": "^1.0" + "ext-filter": "^7.1", + "php": "^7.2", + "phpdocumentor/reflection-common": "^2.0", + "phpdocumentor/type-resolver": "^1.0", + "webmozart/assert": "^1" }, "require-dev": { - "doctrine/instantiator": "^1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "doctrine/instantiator": "^1", + "mockery/mockery": "^1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -435,33 +433,36 @@ { "name": "Mike van Riel", "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-09-12T14:27:41+00:00" + "time": "2020-02-22T12:28:44+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95", + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95", "shasum": "" }, "require": { - "php": "^7.1", + "php": "^7.2", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "^7.1", - "mockery/mockery": "~1", - "phpunit/phpunit": "^7.0" + "ext-tokenizer": "^7.2", + "mockery/mockery": "~1" }, "type": "library", "extra": { @@ -485,37 +486,37 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2019-08-22T18:11:29+00:00" + "time": "2020-02-18T18:59:58+00:00" }, { "name": "phpspec/prophecy", - "version": "1.9.0", + "version": "v1.10.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" + "reference": "451c3cd1418cf640de218914901e51b064abb093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", + "phpspec/phpspec": "^2.5 || ^3.2", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { @@ -548,7 +549,7 @@ "spy", "stub" ], - "time": "2019-10-03T11:07:50+00:00" + "time": "2020-03-05T15:02:03+00:00" }, { "name": "phpunit/php-code-coverage", @@ -804,16 +805,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.5.17", + "version": "7.5.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a" + "reference": "9467db479d1b0487c99733bb1e7944d32deded2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4c92a15296e58191a4cd74cff3b34fc8e374174a", - "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c", + "reference": "9467db479d1b0487c99733bb1e7944d32deded2c", "shasum": "" }, "require": { @@ -884,7 +885,7 @@ "testing", "xunit" ], - "time": "2019-10-28T10:37:36+00:00" + "time": "2020-01-08T08:45:45+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1053,16 +1054,16 @@ }, { "name": "sebastian/environment", - "version": "4.2.2", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404" + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", "shasum": "" }, "require": { @@ -1102,7 +1103,7 @@ "environment", "hhvm" ], - "time": "2019-05-05T09:05:15+00:00" + "time": "2019-11-20T08:46:58+00:00" }, { "name": "sebastian/exporter", @@ -1454,16 +1455,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.2", + "version": "3.5.4", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7" + "reference": "dceec07328401de6211037abbb18bda423677e26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", - "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dceec07328401de6211037abbb18bda423677e26", + "reference": "dceec07328401de6211037abbb18bda423677e26", "shasum": "" }, "require": { @@ -1501,20 +1502,20 @@ "phpcs", "standards" ], - "time": "2019-10-28T04:36:32+00:00" + "time": "2020-01-30T22:20:29+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.15.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14", + "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14", "shasum": "" }, "require": { @@ -1526,7 +1527,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.15-dev" } }, "autoload": { @@ -1559,7 +1560,21 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-02-27T09:26:54+00:00" }, { "name": "theseer/tokenizer", @@ -1603,31 +1618,29 @@ }, { "name": "webmozart/assert", - "version": "1.5.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + "reference": "aed98a490f9a8f78468232db345ab9cf606cf598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "url": "https://api.github.com/repos/webmozart/assert/zipball/aed98a490f9a8f78468232db345ab9cf606cf598", + "reference": "aed98a490f9a8f78468232db345ab9cf606cf598", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "vimeo/psalm": "<3.6.0" + }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -1649,20 +1662,20 @@ "check", "validate" ], - "time": "2019-08-24T08:43:50+00:00" + "time": "2020-02-14T12:15:55+00:00" }, { "name": "wp-coding-standards/wpcs", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "8c7a2e7682de9ef5955251874b639deda51ef470" + "reference": "f90e8692ce97b693633db7ab20bfa78d930f536a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/8c7a2e7682de9ef5955251874b639deda51ef470", - "reference": "8c7a2e7682de9ef5955251874b639deda51ef470", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/f90e8692ce97b693633db7ab20bfa78d930f536a", + "reference": "f90e8692ce97b693633db7ab20bfa78d930f536a", "shasum": "" }, "require": { @@ -1685,7 +1698,7 @@ "authors": [ { "name": "Contributors", - "homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors" + "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" } ], "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", @@ -1694,7 +1707,7 @@ "standards", "wordpress" ], - "time": "2019-04-08T10:53:57+00:00" + "time": "2019-11-11T12:34:03+00:00" } ], "aliases": [], @@ -1703,5 +1716,6 @@ "prefer-stable": false, "prefer-lowest": false, "platform": [], - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } diff --git a/css/utmdotcodes.min.css b/css/utmdotcodes.min.css index 607acba..9a0b1b1 100644 --- a/css/utmdotcodes.min.css +++ b/css/utmdotcodes.min.css @@ -1 +1 @@ -.utmdclink-count:before{content:"\f103"!important;color:transparent!important;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yMi4yMjIgLTIyLjIyMiAxNDQuNDQ0IDE1NS41NTYiPjxnIGZpbGw9IiM4Mjg3OGMiPjxwYXRoIGQ9Ik02Ni42NjcgMGMtOC44OSAwLTE3LjIyMyAzLjg4OS0yMy4zMzQgOS40NDQgNC40NDUgMS4xMTIgOC4zMzQgMi43NzggMTEuNjY3IDUgMy4zMzMtMi4yMjIgNy4yMjItMy4zMzMgMTEuNjY3LTMuMzMzIDEyLjIyMiAwIDIyLjIyMiAxMCAyMi4yMjIgMjIuMjIydjI3Ljc3OGMwIDEyLjIyMi0xMCAyMi4yMjItMjIuMjIyIDIyLjIyMnMtMjIuMjIzLTEwLTIyLjIyMy0yMi4yMjJWNDEuNjY3Yy0yLjc3Ny0zLjMzNC02LjY2Ni01LjU1Ni0xMS4xMS01LjU1NnYyNWMwIDE4LjMzMyAxNSAzMy4zMzMgMzMuMzMzIDMzLjMzM1MxMDAgNzkuNDQ0IDEwMCA2MS4xMTFWMzMuMzMzQzEwMCAxNSA4NSAwIDY2LjY2NyAweiIvPjxwYXRoIGQ9Ik0zMy4zMzMgMTExLjExMWM4Ljg5IDAgMTcuMjIzLTMuODg5IDIzLjMzNC05LjQ0NC00LjQ0NS0xLjExMS04LjMzNC0yLjc3OC0xMS42NjctNUM0MS42NjcgOTguODg5IDM3Ljc3OCAxMDAgMzMuMzMzIDEwMGMtMTIuMjIyIDAtMjIuMjIyLTEwLTIyLjIyMi0yMi4yMjJWNTBjMC0xMi4yMjIgMTAtMjIuMjIyIDIyLjIyMi0yMi4yMjJzMjIuMjIzIDEwIDIyLjIyMyAyMi4yMjJ2MTkuNDQ0QzU4LjMzMyA3Mi43NzggNjIuMjIyIDc1IDY2LjY2NiA3NVY1MGMwLTE4LjMzMy0xNS0zMy4zMzMtMzMuMzMzLTMzLjMzM1MwIDMxLjY2NyAwIDUwdjI3Ljc3OEMwIDk2LjExIDE1IDExMS4xMSAzMy4zMzMgMTExLjExeiIvPjwvZz48L3N2Zz4=")!important;background-size:auto 100%;background-repeat:no-repeat}#utmdc_link_meta_box{margin-top:-20px}#utmdc_link_meta_box button.handlediv,#utmdc_link_meta_box h2.hndle,#utmdc_link_meta_box label span{display:none}#utmdc_link_meta_box input:not([type=checkbox]){width:250px;min-width:25%;max-width:100%}#utmdc_link_meta_box input:not([type=checkbox])#utmdclink_url{width:400px;min-width:50%;max-width:100%}#utmdc_link_meta_box.batch-active .utmdclink_medium input,#utmdc_link_meta_box.batch-active .utmdclink_source input{display:none}#utmdc_link_meta_box.batch-active .utmdclink_medium span,#utmdc_link_meta_box.batch-active .utmdclink_source span{display:block;padding:10px 0;font-weight:700}#utmdc_link_meta_box .utmdclink_notes textarea{width:100%;min-height:200px;padding:10px;resize:vertical}.utmdclinks-copy{width:100%;max-width:100%;margin-bottom:10px}#utm_dot_codes_logo{width:250px;margin:auto;display:block}#utmdclinks_notes_preview_row.hidden{display:none}.utmdclinks-settings-social{-webkit-box-orient:horizontal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.utmdclinks-settings-social,.utmdclinks-settings-social label{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-direction:normal}.utmdclinks-settings-social label{-webkit-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;width:75px;padding:0 .5rem;font-size:1rem;line-height:1.25rem;text-align:center;margin-bottom:1rem}.utmdclinks-settings-social label i{font-size:3rem}.utmdclinks-settings-social label input{margin:.5rem}.utmdclinks-settings-toggle{position:relative}.utmdclinks-settings-toggle *,.utmdclinks-settings-toggle :after,.utmdclinks-settings-toggle :before{-webkit-box-sizing:border-box;box-sizing:border-box}.utmdclinks-settings-toggle input[type=checkbox]{opacity:0;position:absolute;top:0;left:0}.utmdclinks-settings-toggle input[type=checkbox][disabled]~label{pointer-events:none;color:rgba(68,68,68,.5)}.utmdclinks-settings-toggle input[type=checkbox][disabled]~label div{opacity:.5}.utmdclinks-settings-toggle input[type=checkbox]:checked~label div{background-color:#0084c4}.utmdclinks-settings-toggle input[type=checkbox]:checked~label div:before{content:attr(data-off);left:0}.utmdclinks-settings-toggle input[type=checkbox]:checked~label div:after{content:attr(data-on);color:#006291;-webkit-transform:translate3d(68px,0,0);transform:translate3d(68px,0,0)}.utmdclinks-settings-toggle label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;width:140px}.utmdclinks-settings-toggle label div{position:relative;-webkit-transition:background-color .3s cubic-bezier(0,1,.5,1);transition:background-color .3s cubic-bezier(0,1,.5,1);background:#515151;height:36px;-webkit-box-flex:0;-webkit-flex:0 0 140px;-ms-flex:0 0 140px;flex:0 0 140px}.utmdclinks-settings-toggle label div:after,.utmdclinks-settings-toggle label div:before{text-transform:uppercase;text-align:center;position:absolute}.utmdclinks-settings-toggle label div:before{color:#fff;left:70px;line-height:36px;width:70px;content:attr(data-on);top:0}.utmdclinks-settings-toggle label div:after{top:2px;left:2px;width:68px;line-height:32px;-webkit-transition:-webkit-transform .3s cubic-bezier(0,1,.5,1);transition:-webkit-transform .3s cubic-bezier(0,1,.5,1);transition:transform .3s cubic-bezier(0,1,.5,1);transition:transform .3s cubic-bezier(0,1,.5,1),-webkit-transform .3s cubic-bezier(0,1,.5,1);color:#444;content:attr(data-off);z-index:5;background:#fff;-webkit-transform:translateZ(0);transform:translateZ(0)}.utmdclinks-settings-slider input[type=range]{background:transparent;-webkit-appearance:none;margin:0;padding:0;width:140px;vertical-align:middle}.utmdclinks-settings-slider input[type=range]:focus{outline:0;-moz-outline-style:0}.utmdclinks-settings-slider input[type=range]:focus::-ms-fill-lower,.utmdclinks-settings-slider input[type=range]:focus::-ms-fill-upper,.utmdclinks-settings-slider input[type=range]:focus::-webkit-slider-runnable-track{background:#0084c4}.utmdclinks-settings-slider input[type=range]::-webkit-slider-runnable-track{width:100%;height:28px;cursor:pointer;background:#0084c4;border:2px solid #0084c4}.utmdclinks-settings-slider input[type=range]::-webkit-slider-thumb{width:28px;height:28px;margin-top:-2px;background:#fff;cursor:pointer;-webkit-appearance:none;border-top:2px solid #0084c4;border-bottom:2px solid #0084c4;border-radius:0}.utmdclinks-settings-slider input[type=range]::-moz-focus-outer{border:0}.utmdclinks-settings-slider input[type=range]::-moz-range-track{width:100%;height:28px;cursor:pointer;background:#0084c4;border:2px solid #0084c4}.utmdclinks-settings-slider input[type=range]::-moz-range-thumb{width:28px;height:28px;background:#fff;cursor:pointer;-webkit-appearance:none;border:0;border-radius:0}.utmdclinks-settings-slider input[type=range]::-ms-track{width:100%;height:28px;cursor:pointer;background:transparent;border-color:transparent;color:transparent}.utmdclinks-settings-slider input[type=range]::-ms-fill-lower,.utmdclinks-settings-slider input[type=range]::-ms-fill-upper{background:#0084c4;border:0}.utmdclinks-settings-slider input[type=range]::-ms-thumb{width:28px;height:26px;background:#fff;cursor:pointer;margin-top:0;border:1px solid #0084c4;border-radius:0}.utmdclinks-settings-slider output{position:relative;display:inline-block;margin-left:25px;padding:7px;margin-top:-5px;width:20px;text-align:center;background:#fff;border:2px solid #0084c4}.utmdclinks-settings-slider output:after,.utmdclinks-settings-slider output:before{right:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.utmdclinks-settings-slider output:before{border-color:transparent #0084c4 transparent transparent;border-width:13px;margin-top:-13px}.utmdclinks-settings-slider output:after{border-color:transparent #fff transparent transparent;border-width:10px;margin-top:-10px}.utmdclinks-settings-select{outline:none;display:block;font-size:16px;font-family:sans-serif;font-weight:500;line-height:28px!important;color:#23282d;padding:0 32px 0 4px!important;width:auto;max-width:100%;border:2px solid #0084c4;-webkit-box-shadow:0 1px 0 1px rgba(0,0,0,.04);box-shadow:0 1px 0 1px rgba(0,0,0,.04);border-radius:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-image:url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230084c4%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"),-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f1f1f1));background-image:url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230084c4%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"),linear-gradient(180deg,#fff 0,#f1f1f1);background-repeat:no-repeat,repeat;background-position:right 8px top 50%,0 0;background-size:12px auto,100%}.utmdclinks-settings-select::-ms-expand{display:none}.utmdclinks-settings-select:active,.utmdclinks-settings-select:focus,.utmdclinks-settings-select:hover{outline:none!important}.taxonomy-utmdclink-label .form-field.term-description-wrap p,.taxonomy-utmdclink-label .form-field.term-name-wrap p,.taxonomy-utmdclink-label .form-field.term-slug-wrap,.taxonomy-utmdclink-label .wp-list-table .row-actions .inline,.taxonomy-utmdclink-label .wp-list-table.tags .column-slug{display:none}.utmdclink_url span{display:inline!important;position:relative}.utmdclink_url span i{font-size:20px;border:1px solid #d8d8d8;border-radius:100%;margin-left:5px;opacity:0;-webkit-transition:opacity .4s;transition:opacity .4s;position:absolute;z-index:5}.utmdclink_url span .fa-circle{color:#f1f1f1;z-index:10}.utmdclink_url span .fa-question-circle{color:#bebebe}.utmdclink_url span .fa-check-circle{color:#46b450}.utmdclink_url span .fa-times-circle{color:#dc3232}.utmdclink_url span .fa-circle{opacity:1}.utmdclink_url span.valid .fa-circle,.utmdclink_url span.valid .fa-question-circle,.utmdclink_url span.valid .fa-times-circle{opacity:0}.utmdclink_url span.valid .fa-check-circle{opacity:1;z-index:10}.utmdclink_url span.invalid .fa-check-circle,.utmdclink_url span.invalid .fa-circle,.utmdclink_url span.invalid .fa-question-circle{opacity:0}.utmdclink_url span.invalid .fa-times-circle{opacity:1;z-index:10}.utmdclink_url span.unknown .fa-check-circle,.utmdclink_url span.unknown .fa-circle,.utmdclink_url span.unknown .fa-times-circle{opacity:0}.utmdclink_url span.unknown .fa-question-circle{opacity:1;z-index:10} \ No newline at end of file +.utmdclink-count:before{content:""!important;color:transparent!important;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ii0yMi4yMjIgLTIyLjIyMiAxNDQuNDQ0IDE1NS41NTYiPjxnIGZpbGw9IiM4Mjg3OGMiPjxwYXRoIGQ9Ik02Ni42NjcgMGMtOC44OSAwLTE3LjIyMyAzLjg4OS0yMy4zMzQgOS40NDQgNC40NDUgMS4xMTIgOC4zMzQgMi43NzggMTEuNjY3IDUgMy4zMzMtMi4yMjIgNy4yMjItMy4zMzMgMTEuNjY3LTMuMzMzIDEyLjIyMiAwIDIyLjIyMiAxMCAyMi4yMjIgMjIuMjIydjI3Ljc3OGMwIDEyLjIyMi0xMCAyMi4yMjItMjIuMjIyIDIyLjIyMnMtMjIuMjIzLTEwLTIyLjIyMy0yMi4yMjJWNDEuNjY3Yy0yLjc3Ny0zLjMzNC02LjY2Ni01LjU1Ni0xMS4xMS01LjU1NnYyNWMwIDE4LjMzMyAxNSAzMy4zMzMgMzMuMzMzIDMzLjMzM1MxMDAgNzkuNDQ0IDEwMCA2MS4xMTFWMzMuMzMzQzEwMCAxNSA4NSAwIDY2LjY2NyAweiIvPjxwYXRoIGQ9Ik0zMy4zMzMgMTExLjExMWM4Ljg5IDAgMTcuMjIzLTMuODg5IDIzLjMzNC05LjQ0NC00LjQ0NS0xLjExMS04LjMzNC0yLjc3OC0xMS42NjctNUM0MS42NjcgOTguODg5IDM3Ljc3OCAxMDAgMzMuMzMzIDEwMGMtMTIuMjIyIDAtMjIuMjIyLTEwLTIyLjIyMi0yMi4yMjJWNTBjMC0xMi4yMjIgMTAtMjIuMjIyIDIyLjIyMi0yMi4yMjJzMjIuMjIzIDEwIDIyLjIyMyAyMi4yMjJ2MTkuNDQ0QzU4LjMzMyA3Mi43NzggNjIuMjIyIDc1IDY2LjY2NiA3NVY1MGMwLTE4LjMzMy0xNS0zMy4zMzMtMzMuMzMzLTMzLjMzM1MwIDMxLjY2NyAwIDUwdjI3Ljc3OEMwIDk2LjExIDE1IDExMS4xMSAzMy4zMzMgMTExLjExeiIvPjwvZz48L3N2Zz4=)!important;background-size:auto 100%;background-repeat:no-repeat}#utmdc_link_meta_box{margin-top:-20px}#utmdc_link_meta_box button.handlediv,#utmdc_link_meta_box h2.hndle,#utmdc_link_meta_box label span{display:none}#utmdc_link_meta_box input:not([type=checkbox]){width:250px;min-width:25%;max-width:100%}#utmdc_link_meta_box input:not([type=checkbox])#utmdclink_url{width:400px;min-width:50%;max-width:100%}#utmdc_link_meta_box.batch-active .utmdclink_medium input,#utmdc_link_meta_box.batch-active .utmdclink_source input{display:none}#utmdc_link_meta_box.batch-active .utmdclink_medium span,#utmdc_link_meta_box.batch-active .utmdclink_source span{display:block;padding:10px 0;font-weight:700}#utmdc_link_meta_box .utmdclink_notes textarea{width:100%;min-height:200px;padding:10px;resize:vertical}.utmdclinks-copy{width:100%;max-width:100%;margin-bottom:10px}#utm_dot_codes_logo{width:250px;margin:auto;display:block}#utmdclinks_notes_preview_row.hidden{display:none}.utmdclinks-settings-social{-webkit-box-orient:horizontal;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-line-pack:start;align-content:flex-start;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-wrap:wrap;flex-wrap:wrap}.utmdclinks-settings-social,.utmdclinks-settings-social label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-direction:normal}.utmdclinks-settings-social label{-webkit-box-orient:vertical;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:75px;padding:0 .5rem;font-size:1rem;line-height:1.25rem;text-align:center;margin-bottom:1rem}.utmdclinks-settings-social label i{font-size:3rem}.utmdclinks-settings-social label input{margin:.5rem}.utmdclinks-settings-toggle{position:relative}.utmdclinks-settings-toggle *,.utmdclinks-settings-toggle :after,.utmdclinks-settings-toggle :before{-webkit-box-sizing:border-box;box-sizing:border-box}.utmdclinks-settings-toggle input[type=checkbox]{opacity:0;position:absolute;top:0;left:0}.utmdclinks-settings-toggle input[type=checkbox][disabled]~label{pointer-events:none;color:rgba(68,68,68,.5)}.utmdclinks-settings-toggle input[type=checkbox][disabled]~label div{opacity:.5}.utmdclinks-settings-toggle input[type=checkbox]:checked~label div{background-color:#0084c4}.utmdclinks-settings-toggle input[type=checkbox]:checked~label div:before{content:attr(data-off);left:0}.utmdclinks-settings-toggle input[type=checkbox]:checked~label div:after{content:attr(data-on);color:#006291;-webkit-transform:translate3d(68px,0,0);transform:translate3d(68px,0,0)}.utmdclinks-settings-toggle label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:140px}.utmdclinks-settings-toggle label div{position:relative;-webkit-transition:background-color .3s cubic-bezier(0,1,.5,1);transition:background-color .3s cubic-bezier(0,1,.5,1);background:#515151;height:36px;-webkit-box-flex:0;-ms-flex:0 0 140px;flex:0 0 140px}.utmdclinks-settings-toggle label div:after,.utmdclinks-settings-toggle label div:before{text-transform:uppercase;text-align:center;position:absolute}.utmdclinks-settings-toggle label div:before{color:#fff;left:70px;line-height:36px;width:70px;content:attr(data-on);top:0}.utmdclinks-settings-toggle label div:after{top:2px;left:2px;width:68px;line-height:32px;-webkit-transition:-webkit-transform .3s cubic-bezier(0,1,.5,1);transition:-webkit-transform .3s cubic-bezier(0,1,.5,1);transition:transform .3s cubic-bezier(0,1,.5,1);transition:transform .3s cubic-bezier(0,1,.5,1),-webkit-transform .3s cubic-bezier(0,1,.5,1);color:#444;content:attr(data-off);z-index:5;background:#fff;-webkit-transform:translateZ(0);transform:translateZ(0)}.utmdclinks-settings-slider input[type=range]{background:transparent;-webkit-appearance:none;margin:0;padding:0;width:140px;vertical-align:middle}.utmdclinks-settings-slider input[type=range]:focus{outline:0;-moz-outline-style:0}.utmdclinks-settings-slider input[type=range]:focus::-ms-fill-lower,.utmdclinks-settings-slider input[type=range]:focus::-ms-fill-upper,.utmdclinks-settings-slider input[type=range]:focus::-webkit-slider-runnable-track{background:#0084c4}.utmdclinks-settings-slider input[type=range]::-webkit-slider-runnable-track{width:100%;height:28px;cursor:pointer;background:#0084c4;border:2px solid #0084c4}.utmdclinks-settings-slider input[type=range]::-webkit-slider-thumb{width:28px;height:28px;margin-top:-2px;background:#fff;cursor:pointer;-webkit-appearance:none;border-top:2px solid #0084c4;border-bottom:2px solid #0084c4;border-radius:0}.utmdclinks-settings-slider input[type=range]::-moz-focus-outer{border:0}.utmdclinks-settings-slider input[type=range]::-moz-range-track{width:100%;height:28px;cursor:pointer;background:#0084c4;border:2px solid #0084c4}.utmdclinks-settings-slider input[type=range]::-moz-range-thumb{width:28px;height:28px;background:#fff;cursor:pointer;-webkit-appearance:none;border:0;border-radius:0}.utmdclinks-settings-slider input[type=range]::-ms-track{width:100%;height:28px;cursor:pointer;background:transparent;border-color:transparent;color:transparent}.utmdclinks-settings-slider input[type=range]::-ms-fill-lower,.utmdclinks-settings-slider input[type=range]::-ms-fill-upper{background:#0084c4;border:0}.utmdclinks-settings-slider input[type=range]::-ms-thumb{width:28px;height:26px;background:#fff;cursor:pointer;margin-top:0;border:1px solid #0084c4;border-radius:0}.utmdclinks-settings-slider output{position:relative;display:inline-block;margin-left:25px;padding:7px;margin-top:-5px;width:20px;text-align:center;background:#fff;border:2px solid #0084c4}.utmdclinks-settings-slider output:after,.utmdclinks-settings-slider output:before{right:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.utmdclinks-settings-slider output:before{border-color:transparent #0084c4 transparent transparent;border-width:13px;margin-top:-13px}.utmdclinks-settings-slider output:after{border-color:transparent #fff transparent transparent;border-width:10px;margin-top:-10px}.utmdclinks-settings-select{outline:none;display:block;font-size:16px;font-family:sans-serif;font-weight:500;line-height:28px!important;color:#23282d;padding:0 32px 0 4px!important;width:auto;max-width:100%;border:2px solid #0084c4;-webkit-box-shadow:0 1px 0 1px rgba(0,0,0,.04);box-shadow:0 1px 0 1px rgba(0,0,0,.04);border-radius:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-image:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230084c4%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E),-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f1f1f1));background-image:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230084c4%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E),linear-gradient(180deg,#fff 0,#f1f1f1);background-repeat:no-repeat,repeat;background-position:right 8px top 50%,0 0;background-size:12px auto,100%}.utmdclinks-settings-select::-ms-expand{display:none}.utmdclinks-settings-select:active,.utmdclinks-settings-select:focus,.utmdclinks-settings-select:hover{outline:none!important}.taxonomy-utmdclink-label .form-field.term-description-wrap p,.taxonomy-utmdclink-label .form-field.term-name-wrap p,.taxonomy-utmdclink-label .form-field.term-slug-wrap,.taxonomy-utmdclink-label .wp-list-table .row-actions .inline,.taxonomy-utmdclink-label .wp-list-table.tags .column-slug{display:none}.utmdclink_url span{display:inline!important;position:relative}.utmdclink_url span i{font-size:20px;border:1px solid #d8d8d8;border-radius:100%;margin-left:5px;opacity:0;-webkit-transition:opacity .4s;transition:opacity .4s;position:absolute;z-index:5}.utmdclink_url span .fa-circle{color:#f1f1f1;z-index:10}.utmdclink_url span .fa-question-circle{color:#bebebe}.utmdclink_url span .fa-check-circle{color:#46b450}.utmdclink_url span .fa-times-circle{color:#dc3232}.utmdclink_url span .fa-circle{opacity:1}.utmdclink_url span.valid .fa-circle,.utmdclink_url span.valid .fa-question-circle,.utmdclink_url span.valid .fa-times-circle{opacity:0}.utmdclink_url span.valid .fa-check-circle{opacity:1;z-index:10}.utmdclink_url span.invalid .fa-check-circle,.utmdclink_url span.invalid .fa-circle,.utmdclink_url span.invalid .fa-question-circle{opacity:0}.utmdclink_url span.invalid .fa-times-circle{opacity:1;z-index:10}.utmdclink_url span.unknown .fa-check-circle,.utmdclink_url span.unknown .fa-circle,.utmdclink_url span.unknown .fa-times-circle{opacity:0}.utmdclink_url span.unknown .fa-question-circle{opacity:1;z-index:10} \ No newline at end of file diff --git a/js/utmdotcodes.min.js b/js/utmdotcodes.min.js index 019a202..c49d19a 100644 --- a/js/utmdotcodes.min.js +++ b/js/utmdotcodes.min.js @@ -1,2 +1 @@ -!function(t){var n={};function e(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,e),s.l=!0,s.exports}e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:i})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(e.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var s in t)e.d(i,s,function(n){return t[n]}.bind(null,s));return i},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){e(1),t.exports=e(8)},function(t,n,e){"use strict";e(2),e(3),e(4),e(5),e(6),e(7)},function(t,n,e){"use strict";var i;(i=jQuery)((function(){i("#utmdclink_batch").on("change",(function(t){i(this).parents("#utmdc_link_meta_box").toggleClass("batch-active",i(this).is(":checked")).find("#utmdclink_source").attr("required",!i(this).is(":checked"))}))}))},function(t,n,e){"use strict";var i;(i=jQuery)((function(){i("#utmdclink_notes").length&&i("#utmdclink_notes").height(i("#utmdclink_notes")[0].scrollHeight)}))},function(t,n,e){"use strict";var i;(i=jQuery)((function(){var t=i("label.utmdclink_url span");function n(n){switch(n){case 200:t.addClass("valid");break;case 400:case 401:case 403:case 404:case 500:case 502:t.addClass("invalid");break;default:t.addClass("unknown")}}i("#utmdclink_url").on("blur",(function(e){t.removeClass(),""!==i(this).val()&&i.ajax({url:ajaxurl,data:{key:utmdcRestApi.actionKey,action:"utmdc_check_url_response",url:i(this).val()}}).done((function(t){n(t.status)})).fail((function(t){n(t.status)}))}))}))},function(t,n,e){"use strict";var i;(i=jQuery)((function(){i(".utmdclinks-copy").on("click",(function(t){i(this).select()}))}))},function(t,n,e){"use strict";var i;(i=jQuery)((function(){i(".utmdclinks-settings-slider input").length&&i(".utmdclinks-settings-slider input").siblings("output").html(i(".utmdclinks-settings-slider input").val()),i(".utmdclinks-settings-slider input").on("input",(function(t){i(this).siblings("output").html(i(this).val())})),i("#utmdclink_notes_show").on("change",(function(t){"checked"===i(this).attr("checked")?i("#utmdclinks_notes_preview_row").removeClass("hidden"):i("#utmdclinks_notes_preview_row").addClass("hidden")}))}))},function(t,n,e){"use strict";var i;(i=jQuery)((function(){i("#utmdclink_shortener").on("change",(function(t){"none"!==i(this).val()?i("#utmdclink_shortener_api_row").removeClass("hidden"):i("#utmdclink_shortener_api_row").addClass("hidden")}))}))},function(t,n,e){t.exports=e.p+"css/utmdotcodes.min.css"}]); -//# sourceMappingURL=utmdotcodes.min.js.map \ No newline at end of file +!function(t){var n={};function r(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=n,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)r.d(e,o,function(n){return t[n]}.bind(null,o));return e},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=33)}([function(t,n,r){(function(n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n&&n)||Function("return this")()}).call(this,r(38))},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n,r){var e=r(3);t.exports=!e((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(2),o=r(6),i=r(13);t.exports=e?function(t,n,r){return o.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n,r){var e=r(2),o=r(18),i=r(7),u=r(17),c=Object.defineProperty;n.f=e?c:function(t,n,r){if(i(t),n=u(n,!0),i(r),o)try{return c(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[n]=r.value),t}},function(t,n,r){var e=r(4);t.exports=function(t){if(!e(t))throw TypeError(String(t)+" is not an object");return t}},function(t,n,r){var e=r(14),o=r(16);t.exports=function(t){return e(o(t))}},function(t,n,r){var e=r(0),o=r(5);t.exports=function(t,n){try{o(e,t,n)}catch(r){e[t]=n}return n}},function(t,n){t.exports={}},function(t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,n,r){var e=r(2),o=r(39),i=r(13),u=r(8),c=r(17),f=r(1),a=r(18),s=Object.getOwnPropertyDescriptor;n.f=e?s:function(t,n){if(t=u(t),n=c(n,!0),a)try{return s(t,n)}catch(t){}if(f(t,n))return i(!o.f.call(t,n),t[n])}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(3),o=r(15),i="".split;t.exports=e((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,r){var e=r(4);t.exports=function(t,n){if(!e(t))return t;var r,o;if(n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!e(o=r.call(t)))return o;if(!n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n,r){var e=r(2),o=r(3),i=r(19);t.exports=!e&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,n,r){var e=r(0),o=r(4),i=e.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},function(t,n,r){var e=r(21),o=Function.toString;"function"!=typeof e.inspectSource&&(e.inspectSource=function(t){return o.call(t)}),t.exports=e.inspectSource},function(t,n,r){var e=r(0),o=r(9),i=e["__core-js_shared__"]||o("__core-js_shared__",{});t.exports=i},function(t,n,r){var e=r(23),o=r(24),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,n,r){var e=r(43),o=r(21);(t.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.6.4",mode:e?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++r+e).toString(36)}},function(t,n,r){var e=r(46),o=r(0),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,n){return arguments.length<2?i(e[t])||i(o[t]):e[t]&&e[t][n]||o[t]&&o[t][n]}},function(t,n,r){var e=r(1),o=r(8),i=r(48).indexOf,u=r(10);t.exports=function(t,n){var r,c=o(t),f=0,a=[];for(r in c)!e(u,r)&&e(c,r)&&a.push(r);for(;n.length>f;)e(c,r=n[f++])&&(~i(a,r)||a.push(r));return a}},function(t,n,r){var e=r(28),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(0),o=r(23),i=r(1),u=r(24),c=r(30),f=r(58),a=o("wks"),s=e.Symbol,l=f?s:s&&s.withoutSetter||u;t.exports=function(t){return i(a,t)||(c&&i(s,t)?a[t]=s[t]:a[t]=l("Symbol."+t)),a[t]}},function(t,n,r){var e=r(3);t.exports=!!Object.getOwnPropertySymbols&&!e((function(){return!String(Symbol())}))},,,function(t,n,r){t.exports=r(34)},function(t,n,r){"use strict";r(35),r(65),r(66),r(67),r(68),r(69)},function(t,n,r){"use strict";var e;r(36),(e=jQuery)((function(){e("#utmdclink_batch").on("change",(function(t){e(this).parents("#utmdc_link_meta_box").toggleClass("batch-active",e(this).is(":checked")).find("#utmdclink_source").attr("required",!e(this).is(":checked"))}))}))},function(t,n,r){"use strict";var e=r(37),o=r(52).find,i=r(59),u=r(64),c=!0,f=u("find");"find"in[]&&Array(1).find((function(){c=!1})),e({target:"Array",proto:!0,forced:c||!f},{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i("find")},function(t,n,r){var e=r(0),o=r(12).f,i=r(5),u=r(40),c=r(9),f=r(44),a=r(51);t.exports=function(t,n){var r,s,l,p,d,v=t.target,h=t.global,y=t.stat;if(r=h?e:y?e[v]||c(v,{}):(e[v]||{}).prototype)for(s in n){if(p=n[s],l=t.noTargetGet?(d=o(r,s))&&d.value:r[s],!a(h?s:v+(y?".":"#")+s,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;f(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),u(r,s,p,t)}}},function(t,n){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,n,r){"use strict";var e={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!e.call({1:2},1);n.f=i?function(t){var n=o(this,t);return!!n&&n.enumerable}:e},function(t,n,r){var e=r(0),o=r(5),i=r(1),u=r(9),c=r(20),f=r(41),a=f.get,s=f.enforce,l=String(String).split("String");(t.exports=function(t,n,r,c){var f=!!c&&!!c.unsafe,a=!!c&&!!c.enumerable,p=!!c&&!!c.noTargetGet;"function"==typeof r&&("string"!=typeof n||i(r,"name")||o(r,"name",n),s(r).source=l.join("string"==typeof n?n:"")),t!==e?(f?!p&&t[n]&&(a=!0):delete t[n],a?t[n]=r:o(t,n,r)):a?t[n]=r:u(n,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&a(this).source||c(this)}))},function(t,n,r){var e,o,i,u=r(42),c=r(0),f=r(4),a=r(5),s=r(1),l=r(22),p=r(10),d=c.WeakMap;if(u){var v=new d,h=v.get,y=v.has,m=v.set;e=function(t,n){return m.call(v,t,n),n},o=function(t){return h.call(v,t)||{}},i=function(t){return y.call(v,t)}}else{var b=l("state");p[b]=!0,e=function(t,n){return a(t,b,n),n},o=function(t){return s(t,b)?t[b]:{}},i=function(t){return s(t,b)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(n){var r;if(!f(n)||(r=o(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}}},function(t,n,r){var e=r(0),o=r(20),i=e.WeakMap;t.exports="function"==typeof i&&/native code/.test(o(i))},function(t,n){t.exports=!1},function(t,n,r){var e=r(1),o=r(45),i=r(12),u=r(6);t.exports=function(t,n){for(var r=o(n),c=u.f,f=i.f,a=0;as;)if((c=f[s++])!=c)return!0}else for(;a>s;s++)if((t||s in f)&&f[s]===r)return t||s||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},function(t,n,r){var e=r(28),o=Math.max,i=Math.min;t.exports=function(t,n){var r=e(t);return r<0?o(r+n,0):i(r,n)}},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,r){var e=r(3),o=/#|\.prototype\./,i=function(t,n){var r=c[u(t)];return r==a||r!=f&&("function"==typeof n?e(n):!!n)},u=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=i.data={},f=i.NATIVE="N",a=i.POLYFILL="P";t.exports=i},function(t,n,r){var e=r(53),o=r(14),i=r(55),u=r(27),c=r(56),f=[].push,a=function(t){var n=1==t,r=2==t,a=3==t,s=4==t,l=6==t,p=5==t||l;return function(d,v,h,y){for(var m,b,g=i(d),x=o(g),_=e(v,h,3),w=u(x.length),j=0,O=y||c,S=n?O(d,w):r?O(d,0):void 0;w>j;j++)if((p||j in x)&&(b=_(m=x[j],j,g),t))if(n)S[j]=b;else if(b)switch(t){case 3:return!0;case 5:return m;case 6:return j;case 2:f.call(S,m)}else if(s)return!1;return l?-1:a||s?s:S}};t.exports={forEach:a(0),map:a(1),filter:a(2),some:a(3),every:a(4),find:a(5),findIndex:a(6)}},function(t,n,r){var e=r(54);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 0:return function(){return t.call(n)};case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,n,r){var e=r(16);t.exports=function(t){return Object(e(t))}},function(t,n,r){var e=r(4),o=r(57),i=r(29)("species");t.exports=function(t,n){var r;return o(t)&&("function"!=typeof(r=t.constructor)||r!==Array&&!o(r.prototype)?e(r)&&null===(r=r[i])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===n?0:n)}},function(t,n,r){var e=r(15);t.exports=Array.isArray||function(t){return"Array"==e(t)}},function(t,n,r){var e=r(30);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,n,r){var e=r(29),o=r(60),i=r(6),u=e("unscopables"),c=Array.prototype;null==c[u]&&i.f(c,u,{configurable:!0,value:o(null)}),t.exports=function(t){c[u][t]=!0}},function(t,n,r){var e,o=r(7),i=r(61),u=r(11),c=r(10),f=r(63),a=r(19),s=r(22),l=s("IE_PROTO"),p=function(){},d=function(t){return"