diff --git a/README.md b/README.md index b103990..f759f42 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ A WordPress plugin to make it easy to collect links from around the web, turn th **Tested up to:** 4.2.3 -**Stable tag:** 0.3.2 +**Stable tag:** 0.4.0 **License:** GPLv2 or later @@ -51,7 +51,7 @@ Installation directly from the WordPress.org plugin directory coming soon! ## Features #### Saved Links -![New Saved Link](https://raw.githubusercontent.com/INN/link-roundups/master/docs/img/new-saved-link.png) +![New Saved Link](https://raw.githubusercontent.com/INN/link-roundups/master/docs/img/new-saved-link-npr.png) Curate links from around the web and save them in WordPress using a handy browser bookmark. You can also add your own descriptions and organize saved links using tags. diff --git a/README.txt b/README.txt index 0819184..034589e 100644 --- a/README.txt +++ b/README.txt @@ -4,7 +4,7 @@ Donate link: http://bit.ly/1N4nSJJ Tags: newsletters, mailchimp, links, curation, aggregation Requires at least: 4.1 Tested up to: 4.2.3 -Stable tag: 0.3.2 +Stable tag: 0.4.0 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -33,6 +33,16 @@ Collect links from around the web, turn them into roundup posts and streamline t == Changelog == += 0.4.0 = + +- Added "roundup block" shortcode and accompanying post editor user interface for editing blocks of saved links +- Manage front-end Javascript dependencies using Bower +- Manage PHP dependencies using Composer +- Uses the wordpress-mailchimp-tools PHP package, brought to you by INN +- Added MailChimp campaign editor meta box to the post editor +- Added MailChimp campaign settings for roundup posts +- Moved MailChimp API Key settings to Settings > MailChimp Settings menu + = 0.3.2 = - Submitted the plugin to WordPress.org diff --git a/bower.json b/bower.json index 7b3f4d3..c4c9c3e 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "link-roundups", - "description": "A WordPress plugin to make it easy to collect links from around the web, turn them into roundup posts and streamline the production of daily/weekly roundup newsletters using MailChimp.", + "description": "A WordPress plugin that makes it easy to collect links, turn them into roundup posts and produce roundup newsletters using MailChimp.", "main": "link-roundups.php", "authors": [ "INN Nerds " diff --git a/docs/img/added-links-modal.png b/docs/img/added-links-modal.png new file mode 100644 index 0000000..8fd77cf Binary files /dev/null and b/docs/img/added-links-modal.png differ diff --git a/docs/img/adding-link-roundup-1.png b/docs/img/adding-link-roundup-1.png new file mode 100644 index 0000000..77f9e19 Binary files /dev/null and b/docs/img/adding-link-roundup-1.png differ diff --git a/docs/img/adding-link-roundup-2.png b/docs/img/adding-link-roundup-2.png new file mode 100644 index 0000000..7d2847d Binary files /dev/null and b/docs/img/adding-link-roundup-2.png differ diff --git a/docs/img/adding-link-roundup-3.png b/docs/img/adding-link-roundup-3.png new file mode 100644 index 0000000..2dbf085 Binary files /dev/null and b/docs/img/adding-link-roundup-3.png differ diff --git a/docs/img/adding-links-modal.png b/docs/img/adding-links-modal.png new file mode 100644 index 0000000..618edb3 Binary files /dev/null and b/docs/img/adding-links-modal.png differ diff --git a/docs/img/all-saved-links.png b/docs/img/all-saved-links.png new file mode 100644 index 0000000..5883492 Binary files /dev/null and b/docs/img/all-saved-links.png differ diff --git a/docs/img/argo-links-menu.png b/docs/img/argo-links-menu.png deleted file mode 100644 index 81bbf87..0000000 Binary files a/docs/img/argo-links-menu.png and /dev/null differ diff --git a/docs/img/bookmarklet-popup.png b/docs/img/bookmarklet-popup.png deleted file mode 100644 index 53fe4cc..0000000 Binary files a/docs/img/bookmarklet-popup.png and /dev/null differ diff --git a/docs/img/edit-saved-links.png b/docs/img/edit-saved-links.png deleted file mode 100644 index 73d284d..0000000 Binary files a/docs/img/edit-saved-links.png and /dev/null differ diff --git a/docs/img/link-roundup-campaign-editor.png b/docs/img/link-roundup-campaign-editor.png new file mode 100644 index 0000000..007f3a3 Binary files /dev/null and b/docs/img/link-roundup-campaign-editor.png differ diff --git a/docs/img/link-roundup-campaign-settings.png b/docs/img/link-roundup-campaign-settings.png new file mode 100644 index 0000000..4751257 Binary files /dev/null and b/docs/img/link-roundup-campaign-settings.png differ diff --git a/docs/img/link-roundup-mailchimp-button.png b/docs/img/link-roundup-mailchimp-button.png new file mode 100644 index 0000000..752708d Binary files /dev/null and b/docs/img/link-roundup-mailchimp-button.png differ diff --git a/docs/img/link-roundup-page-example.png b/docs/img/link-roundup-page-example.png new file mode 100644 index 0000000..ef181e5 Binary files /dev/null and b/docs/img/link-roundup-page-example.png differ diff --git a/docs/img/link-roundup-send-test.png b/docs/img/link-roundup-send-test.png new file mode 100644 index 0000000..009042c Binary files /dev/null and b/docs/img/link-roundup-send-test.png differ diff --git a/docs/img/link-roundups-mailchimp-settings.png b/docs/img/link-roundups-mailchimp-settings.png new file mode 100644 index 0000000..68cf3c2 Binary files /dev/null and b/docs/img/link-roundups-mailchimp-settings.png differ diff --git a/docs/img/link-roundups-widget-in-sidebar.png b/docs/img/link-roundups-widget-in-sidebar.png new file mode 100644 index 0000000..279df47 Binary files /dev/null and b/docs/img/link-roundups-widget-in-sidebar.png differ diff --git a/docs/img/links-roundup-posts-on-homepage.png b/docs/img/links-roundup-posts-on-homepage.png new file mode 100644 index 0000000..7f1177c Binary files /dev/null and b/docs/img/links-roundup-posts-on-homepage.png differ diff --git a/docs/img/mailchimp-campaign-preview.png b/docs/img/mailchimp-campaign-preview.png new file mode 100644 index 0000000..b8aa328 Binary files /dev/null and b/docs/img/mailchimp-campaign-preview.png differ diff --git a/docs/img/new-link-roundup.png b/docs/img/new-link-roundup.png new file mode 100644 index 0000000..6f38692 Binary files /dev/null and b/docs/img/new-link-roundup.png differ diff --git a/docs/img/new-saved-link-npr.png b/docs/img/new-saved-link-npr.png new file mode 100644 index 0000000..38980c7 Binary files /dev/null and b/docs/img/new-saved-link-npr.png differ diff --git a/docs/img/new-saved-link-screen.png b/docs/img/new-saved-link-screen.png new file mode 100644 index 0000000..a688fb7 Binary files /dev/null and b/docs/img/new-saved-link-screen.png differ diff --git a/docs/img/new-saved-link.png b/docs/img/new-saved-link.png deleted file mode 100644 index 276f391..0000000 Binary files a/docs/img/new-saved-link.png and /dev/null differ diff --git a/docs/img/recent-links-sidebar.png b/docs/img/recent-links-sidebar.png new file mode 100644 index 0000000..3b0e65f Binary files /dev/null and b/docs/img/recent-links-sidebar.png differ diff --git a/docs/img/roundup_block_1.png b/docs/img/roundup_block_1.png new file mode 100644 index 0000000..3717ce8 Binary files /dev/null and b/docs/img/roundup_block_1.png differ diff --git a/docs/img/save-to-site-bookmarklet-in-browser.png b/docs/img/save-to-site-bookmarklet-in-browser.png new file mode 100644 index 0000000..1654ef5 Binary files /dev/null and b/docs/img/save-to-site-bookmarklet-in-browser.png differ diff --git a/docs/img/save-to-site-bookmarklet-page.png b/docs/img/save-to-site-bookmarklet-page.png new file mode 100644 index 0000000..843de5f Binary files /dev/null and b/docs/img/save-to-site-bookmarklet-page.png differ diff --git a/docs/img/saved-links-widget.png b/docs/img/saved-links-widget.png new file mode 100644 index 0000000..4c6ce8c Binary files /dev/null and b/docs/img/saved-links-widget.png differ diff --git a/docs/img/todays-links.png b/docs/img/todays-links.png new file mode 100644 index 0000000..ec944eb Binary files /dev/null and b/docs/img/todays-links.png differ diff --git a/docs/link-roundups.md b/docs/link-roundups.md index 8d15f96..3cf0d7a 100644 --- a/docs/link-roundups.md +++ b/docs/link-roundups.md @@ -1,28 +1,64 @@ -## How to Create Link Roundups +# How to Create Link Roundups -Now that you have some Saved Links, you're ready to create your first Link Roundup. +Assuming you have some [Saved Links](/docs/saved-links.md), you're ready to create your first Link Roundup. -1) Go to Link Roundups and click Add New from your WordPress Dashboard. +1) Go to **Link Roundups** and click Add Link Roundup from your WordPress Dashboard. -![Finding "Link Roundups > Add New" in the menu](img/new-roundup.png) +![New Link Roundup link in the Dashboard](./img/new-link-roundup.png) The new Link Roundup post will resemble a regular WordPress post in many ways... but there is one important difference: the Recent Saved Links Panel below the Editor. -Recent Saved Links lets you sort through links based on the date they were created. +Recent Saved Links lets you sort through Saved Links based on the date they were created. -![Screenshot showing how to choose links to add to a roundup post](img/recent-roundup-links.png) +![New Link Roundup link in the Dashboard](./img/adding-link-roundup-1.png) -2) Select one or more links to add to your roundup by sending them to the Editor. +2) Select one or more links to add to your roundup by clicking the **Send to Editor** button. The Recent Saved Links section shows a maximum of 15 links at one time. Use the pagination to view more pages of Saved Links, but bear in mind you must send links to the editor before switching pages -- the box won't remember links you checked on other pages, only links currently displayed. -Once you have the links that make up your roundup in the editor window, you can edit the links, change the description and make any adjustments that you'd make to a normal post. If you'd like to add a description to the post, go to the first line of the roundup and add a new line. You'll likely notice that the roundup icon that appears to the left of new roundup links appears on the blank line. To remove this icon, select "Paragraph" from the formatting menu and the formatting will be removed. +![New Link Roundup link in the Dashboard](./img/adding-link-roundup-2.png) -![Screenshot showing the post editor](img/link-roundup-heading.png) +Once you have the links that make up your roundup in the editor window, you can edit the links, change the description and make any adjustments that you'd make to a normal post. If you'd like to add a description to the post, go to the first line of the roundup and add a new line. -When you're satisfied with the description and links that you've added to your roundup, publish your post and congratulate yourself on some excellent curatorial work. +![New Link Roundup link in the Dashboard](./img/adding-link-roundup-3.png) -# Link Roundups Options +## Add Categories and Tags + +You can also add Categories and Tags to the Link Roundup, like any other post. _Adding one or more Categories allows filtering display of Link Roundups by Category_. + +## Creating a Link Roundup using roundup_block Shortcode + +An alternative way to create a Link Round is to use a special shortcode with this format: + +`[roundup_block name="Today's Links"]` + +The name will be displayed as a header so just change it as desired. When you add this shortcode you'll see the name of the header in a grey box: + +![Link Roundups shortcode displayed in the visual editor](./img/roundup_block_1.png) + +Hover over the box and a pencil icon appears. Click the pencil, and you'll be presented with a modal window to edit the contents: + +![adding links to a roundup](./img/adding-links-modal.png) + +Under each available item, click the Add button to add it to the Link Roundup: + +![Links added to a roundup](./img/added-links-modal.png) + +Click the Save button in the modal window and return to find your links in the Link Roundup edit screen: + +![Links added to a roundup](./img/todays-links.png) + +## How Link Roundups are Displayed On Your Site + +Once you Publish the Link Roundup post, it displays in your homepage content stream like any other post: + +![Link Roundups on the homepage](./img/links-roundup-posts-on-homepage.png) + +Each Link Roundup also has its own single-post page which displays its Saved Links which link to the original source: + +![Link Roundup post page](./img/link-roundup-page-example.png) + +## Link Roundups Options Link Roundups Options enable the following: - Rename the Link Roundups Post Type (including public URL slug!) diff --git a/docs/mailchimp.md b/docs/mailchimp.md index 5bedb80..6cef47d 100644 --- a/docs/mailchimp.md +++ b/docs/mailchimp.md @@ -14,13 +14,13 @@ In order to use the MailChimp features of Link Roundups, you'll need to sign up 2. Click on your account in the upper-right corner. In the drop-down menu, click "Account". 3. Click on "Extras", then "API keys". 4. Click "Create A Key". A new key will appear in the list. -5. Click the "Label" field of your new API key. Name it after the site you're using Argo Links on. For example: "example.com argo links" +5. Click the "Label" field of your new API key. Name it after the site you're using Link Roundups on. For example: "example.com links" 6. Copy the API key. This will be a long string of characters from 0-9 and a-f. -7. On your website, go to Dashboard > Link Roundups > Options. -8. Paste the MailChimp API Key into the appropriate field, then check "Enable MailChimp API Integration". +7. On your WordPress site, go to **Dashboard > Settings > MailChimp Settings**. +8. Paste the MailChimp API Key into the appropriate field. 9. Press "Save Changes". -Next: Creating a template in Mailchimp that your post will use. +![Link Roundups MailChimp API settings](./img/link-roundups-mailchimp-settings.png) ## Creating a template in the MailChimp dashboard @@ -47,9 +47,9 @@ Then, edit the template to insert the following tags where you want them to appe #### Required Tags: -If these template tags are not present in your MailChimp template, you will be unable to create a new Argo Links Roundup Email Campaign. +If these template tags are not present in your MailChimp template, you will be unable to create a new Links Roundup Email Campaign. -- `*|ROUNDUPLINKS|*` - The actual list of links from the Argo Links Roundup post +- `*|ROUNDUPLINKS|*` - The actual list of links from the Links Roundup post #### Optional Tags: @@ -60,14 +60,32 @@ These template tags are not required, but you may wish to use them in your templ - `*|ROUNDUPDATE|*` - The date the Links Roundu post was published - `*|ROUNDUPPERMALINK|*` - A link back to the original Link Roundup post -## Choosing the template to use +## Choosing the MailChimp Template and List to use -So now you have at least one template saved in MailChimp. Go back to the Link Roundups Options page in Dashboard » Link Roundups » Options, and choose your template. +So now you have at least one template saved in MailChimp, and we're assuming you also have a list of subscribers for your newsletter. In the WordPress Dashboard go to **Link Roundups > MailChimp Campaign Settings**, and choose your default campaign type, default mailing list, default template, and email address(es) for campaign tests: + +![Link Roundups MailChimp Campaign settings](./img/link-roundup-campaign-settings.png) # Creating a MailChimp Campaign -Once you have [saved some links](saving-links.md) and [created a link roundup post](link-roundups.md), you can send the link roundup post to MailChimp as a draft campaign. +Once you have [saved some links](saving-links.md) and [created a Link Roundup post](link-roundups.md), you can send the Link Roundup post to MailChimp as a draft campaign. + +In the Link Roundups editor make sure the **Mailchimp Campaign Editor** is visible. If not, visit Screen Options and select it to make it visible. You can now: + +- Choose a campaign type +- Choose a list to send to +- Give your campaign a title +- Add the campaign subject line for email +- Choose which MailChimp template to use for the campaign (defaults to what was set in Link Roundups > MailChimp Campaign Settings) + +![Mailchimp Campaign Editor panel in the post editor](./img/link-roundup-campaign-editor.png) + +Click the **Create Draft** button to create a draft MailChimp campaign. You can then view the draft campaign in your [MailChimp campaigns](https://us13.admin.mailchimp.com/campaigns/), and make any needed changes there before sending. You can also send a test email from the Link Roundup edit screen: + +![Send Test button in the Link Roundups edit screen](./img/link-roundup-send-test.png) + +The **Send Test** button won't appear until after creating a draft campaign. You will then also see a new **MailChimp Campaign Preview** screen on the right side of the Link Roundup edit screen, where you can preview the campaign in a new window, or preview and edit the campaign in MailChimp: -In the Link Roundups editor, above the standard WordPress "Publish" button you'll find a button to "Create a MailChimp Campaign." +![MailChimp Campaign Preview panel in the Link Roundups edit screen](./img/mailchimp-campaign-preview.png) -When you click "Create a MailChimp Campaign" you will be asked to confirm the action. The Link Roundups plugin will contact MailChimp to create the campaign and, upon success, present you with a link to finish editing the campaign in the MailChimp dashboard. +When the draft campaign is ready to go, hist the **Send Now** button to launch the MailChimp campaign. You can also choose to launch the campaign from MailChimp if preferred. \ No newline at end of file diff --git a/docs/readme.md b/docs/readme.md index 106da6c..ef7be07 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -1,8 +1,13 @@ # Link Roundups Documentation -![link roundup](img/published-roundup.png) +Link Roundups is a WordPress plugin that makes it easy to: -This plugin makes it easy to collect links from across the web and share them right from your WordPress Dashboard. +- collect links from around the web and save them in WordPress as Saved Links +- turn them into Link Roundup posts +- display Saved Links and Link Roundups in WordPress widgets on your site +- streamline the production of daily/weekly roundup newsletters using MailChimp + +![link roundup post on a website](img/link-roundup-page-example.png) Get the brief introduction to plugin features in [the main Readme.md file](https://github.com/INN/link-roundups/blob/master/README.md). diff --git a/docs/saved-links.md b/docs/saved-links.md index a331c48..80da21b 100644 --- a/docs/saved-links.md +++ b/docs/saved-links.md @@ -5,20 +5,41 @@ Once you've [installed and activated the plugin](installation.md), you should se ## Save Links via Browser Bookmark Tool (Recommended) 1. Under Saved Links, navigate to Add Browser Bookmark (Save to Site) + +![installing Save to Site bookmarklet in WordPress](img/save-to-site-bookmarklet-page.png) + 2. Install by dragging on to the bookmark bar of your preferred web browser. + +![Save to Site bookmarklet installed in a browser toolbar](img/save-to-site-bookmarklet-in-browser.png) + 3. Test by finding a great internet link and clicking your bookmark. -4. A popup will appear (you may need to adjust your browser settings to allow the popup to be displayed) with a new Saved Link screen. If you're not logged in to your WordPress site, a login screen will appear before you're passed through. The Save to Site Bookmark Tool attempts to prefill **Title**, **URL** and **Source** information -- saving you time! It will even attempt to grab a **featured image** and import that to WordPress (featured images are still a beta feature and we have improvements planned for this soon) + +4. A popup will appear (you may need to adjust your browser settings to allow the popup to be displayed) with a new Saved Link screen. If you're not logged in to your WordPress site, a login screen will appear before you're passed through. The Save to Site Bookmark Tool attempts to prefill **Title**, **URL** and **Source** information -- saving you time! It will even attempt to grab a **featured image** and import that to WordPress (featured images are still a beta feature and we have improvements planned for this soon). + +![Saving a link to a story in the Saved Links bookmarklet popup screen](img/new-saved-link-npr.png) + 5. **Publish** your Saved Link and resume normal web browsing. ## Save Links Manually from the WordPress Dashboard 1. In WordPress find Saved Links in the main menu and navigate to New Saved Link. + +![Saved links area of the WordPress dashboard](img/new-saved-link-screen.png) + 2. Add a Title for your Link 3. A URL is required, paste a valid URL in the URL field. -3. Optionally define a custom slug, provide a short description and the source of your Saved Link. +3. Optionally define a custom slug, add a Featured Image, and provide a short description and the source of your Saved Link. + +## Editing Saved Links + +Visit the dashboard screen under **Saved Links > Saved Links** to see all your Saved Links. You can edit them just like other post types. + +![Saved links area of the WordPress dashboard](img/all-saved-links.png) -![Link Roundups This!](img/argo-links-menu.png) +## Using Saved Links in Link Roundups -![Screenshot showing the Link Roundups This! bookmarklet in use](img/bookmarklet-popup.png) +Now that you have some Saved Links you can: -![Screenshot showing the Link Roundups area of the WordPress dashboard](img/links-dashboard.png) \ No newline at end of file +- [Use them in Link Roundups posts](/docs/link-roundups.md) which display like other posts on your site. +- If you have a MailChimp account for your email newsletter, you can also easily [publish Link Roundup posts as MailChimp campaigns](/docs/mailchimp.md) from your WordPress dashboard. +- You can also display Saved Links in the [Saved Links Widget](/docs/widgets.md). \ No newline at end of file diff --git a/docs/widgets.md b/docs/widgets.md index 0242fd7..5a433c3 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -1,13 +1,19 @@ # Widgets -### Adding Widgets +## Adding Widgets -Widgets can be added in the WordPress Dashboard under Appearance > Widgets, or alternatively in the WordPress Customizer under the Widgets Panel. Drag the desired widget into your desired sidebar or widget area (or click Add Widget in your desired sidebar in the case of the Customizer). +Widgets can be added in the WordPress Dashboard under **Appearance > Widgets**, or alternatively in the WordPress Customizer under the **Widgets Panel**. Drag the desired widget into your desired sidebar or widget area (or click Add Widget in your desired sidebar in the case of the Customizer). -#### 1. Saved Links Widget (since 0.1) +## 1. Saved Links Widget (since 0.1) The Saved Links Widget gathers Saved Links (optionally filtered by your Saved Link Tags) and displays them as a list similar to a list of Recent Posts. You can control the number of Saved Links to show, the length of the description excerpt, control display for different devices and a hyperlinked widget title for the feed. -#### 2. Link Roundups Widget (since 0.3) +![Saved Links Widget on a post page](./img/recent-links-sidebar.png) -The Link Roundups Widget shows the most recent Link Roundup(s), which can be limited to a category. You can control the number of Link Roundups to show, the category to limit to (at present must be a single category, so use nested categories for multiple), control display for different devices and a hyperlinked widget title above the headline (i.e. "Latest Digest") \ No newline at end of file +## 2. Link Roundups Widget (since 0.3) + +After creating one or more Link Roundups, you can use the Link Roundups Widget to create links to your Link Roundups. The Link Roundups Widget shows the most recent Link Roundup(s), which can be limited to a category. + +![Link Roundups widget displayed in a sidebar](./img/link-roundups-widget-in-sidebar.png) + +Widget options include filtering display of Link Roundups by Category, changing the default Title of "Recent Link Roundups," and adding a link and URL at the bottom of the widget. \ No newline at end of file diff --git a/inc/link-roundups/class-link-roundups-editor.php b/inc/link-roundups/class-link-roundups-editor.php index 078b16f..6605c23 100644 --- a/inc/link-roundups/class-link-roundups-editor.php +++ b/inc/link-roundups/class-link-roundups-editor.php @@ -293,14 +293,28 @@ public static function roundup_update_post() { } public static function roundup_block_posts_query() { + $month_ago = strtotime('-30 days'); + $now = strtotime('now'); + // Default arguments $args = apply_filters('link_roundups_roundup_block_post_query', array( 'post_type' => 'rounduplink', 'orderby' => 'date', 'order' => 'desc', 'posts_per_page' => -1, - 'year' => date( 'Y' ), - 'monthnum' => date( 'm' ) + 'date_query' => array( + 'after' => array( + 'year' => date( 'Y', $month_ago ), + 'month' => date( 'n', $month_ago ), + 'day' => date( 'j', $month_ago ) + ), + 'before' => array( + 'year' => date( 'Y', $now ), + 'month' => date( 'n', $now ), + 'day' => date( 'j', $now ) + ), + 'inclusive' => true + ) )); $query = new WP_Query($args); $posts = $query->get_posts(); diff --git a/lang/link-roundups.pot b/lang/link-roundups.pot index fca6826..82679d6 100644 --- a/lang/link-roundups.pot +++ b/lang/link-roundups.pot @@ -1,14 +1,14 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# This file is distributed under the same license as the link-roundups package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: link-roundups 0.3.2\n" +"Project-Id-Version: link-roundups 0.4.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-08-26 10:06-0500\n" +"POT-Creation-Date: 2016-06-03 15:03-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,54 +18,53 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" -#: inc/lroundups/class-lroundups.php:260 -msgid "" -"Curl is not enabled on your server. The MailChimp features will not work " -"without curl. Please contact your server administrator to have curl enabled." -msgstr "" - -#: inc/lroundups/widget.php:13 +#: inc/link-roundups/class-link-roundups-widget.php:13 msgid "Link Roundups Widget" msgstr "" -#: inc/lroundups/widget.php:52 +#: inc/link-roundups/class-link-roundups-widget.php:51 msgid "" "

You don't have any recent links or the Link " "Roundups plugin is not active.

" msgstr "" -#: inc/lroundups/widget.php:84 inc/saved-links/widget.php:93 +#: inc/link-roundups/class-link-roundups-widget.php:83 +#: inc/saved-links/class-saved-links-widget.php:122 msgid "Title:" msgstr "" -#: inc/lroundups/widget.php:89 inc/saved-links/widget.php:98 +#: inc/link-roundups/class-link-roundups-widget.php:88 +#: inc/saved-links/class-saved-links-widget.php:127 msgid "Number of posts to show:" msgstr "" -#: inc/lroundups/widget.php:94 +#: inc/link-roundups/class-link-roundups-widget.php:93 msgid "Limit to category: " msgstr "" -#: inc/lroundups/widget.php:95 +#: inc/link-roundups/class-link-roundups-widget.php:94 msgid "None (all categories)" msgstr "" -#: inc/lroundups/widget.php:98 +#: inc/link-roundups/class-link-roundups-widget.php:97 msgid "More Link" msgstr "" -#: inc/lroundups/widget.php:98 inc/saved-links/widget.php:114 +#: inc/link-roundups/class-link-roundups-widget.php:97 +#: inc/saved-links/class-saved-links-widget.php:148 msgid "" "If you would like to add a more link at the bottom of the widget, add the " "link text and url here." msgstr "" -#: inc/lroundups/widget.php:100 inc/saved-links/widget.php:116 +#: inc/link-roundups/class-link-roundups-widget.php:99 +#: inc/saved-links/class-saved-links-widget.php:150 msgid "Link text:" msgstr "" -#: inc/lroundups/widget.php:105 inc/saved-links/class-saved-links.php:166 -#: inc/saved-links/widget.php:121 +#: inc/link-roundups/class-link-roundups-widget.php:104 +#: inc/saved-links/class-saved-links-widget.php:155 +#: inc/saved-links/class-saved-links.php:175 msgid "URL:" msgstr "" @@ -97,174 +96,206 @@ msgstr "" msgid "Show All" msgstr "" -#: inc/saved-links/class-saved-links-list-table.php:258 +#: inc/saved-links/class-saved-links-list-table.php:262 #, php-format msgid "Select %s" msgstr "" -#: inc/saved-links/class-saved-links.php:78 -#: inc/saved-links/class-saved-links.php:90 +#: inc/saved-links/class-saved-links-widget.php:12 +msgid "Show your most recently saved links in a sidebar widget" +msgstr "" + +#: inc/saved-links/class-saved-links-widget.php:14 +msgid "Saved Links Widget" +msgstr "" + +#: inc/saved-links/class-saved-links-widget.php:22 +#: inc/saved-links/class-saved-links-widget.php:110 +msgid "Recent Links" +msgstr "" + +#: inc/saved-links/class-saved-links-widget.php:68 +#: inc/saved-links/class-saved-links.php:681 +msgid "Source: " +msgstr "" + +#: inc/saved-links/class-saved-links-widget.php:87 +msgid "" +"

You don't have any recent links or the link " +"roundups plugin is not active.

" +msgstr "" + +#: inc/saved-links/class-saved-links-widget.php:133 +msgid "Open links in new window" +msgstr "" + +#: inc/saved-links/class-saved-links-widget.php:138 +msgid "Excerpt Length (# of Sentences):" +msgstr "" + +#: inc/saved-links/class-saved-links-widget.php:145 +msgid "Show featured images?" +msgstr "" + +#: inc/saved-links/class-saved-links.php:72 +#: inc/saved-links/class-saved-links.php:84 msgid "Saved Links" msgstr "" -#: inc/saved-links/class-saved-links.php:79 +#: inc/saved-links/class-saved-links.php:73 msgid "Saved Link" msgstr "" -#: inc/saved-links/class-saved-links.php:80 -#: inc/saved-links/class-saved-links.php:81 +#: inc/saved-links/class-saved-links.php:74 +#: inc/saved-links/class-saved-links.php:75 msgid "New Saved Link" msgstr "" -#: inc/saved-links/class-saved-links.php:82 +#: inc/saved-links/class-saved-links.php:76 msgid "Edit" msgstr "" -#: inc/saved-links/class-saved-links.php:83 +#: inc/saved-links/class-saved-links.php:77 msgid "Edit Saved Link" msgstr "" -#: inc/saved-links/class-saved-links.php:84 +#: inc/saved-links/class-saved-links.php:78 msgid "View" msgstr "" -#: inc/saved-links/class-saved-links.php:85 +#: inc/saved-links/class-saved-links.php:79 msgid "View Saved Link" msgstr "" -#: inc/saved-links/class-saved-links.php:86 +#: inc/saved-links/class-saved-links.php:80 msgid "Search Saved Links" msgstr "" -#: inc/saved-links/class-saved-links.php:87 +#: inc/saved-links/class-saved-links.php:81 msgid "No Saved Links found" msgstr "" -#: inc/saved-links/class-saved-links.php:88 +#: inc/saved-links/class-saved-links.php:82 msgid "No Saved Links found in Trash" msgstr "" -#: inc/saved-links/class-saved-links.php:112 +#: inc/saved-links/class-saved-links.php:121 msgid "Saved Link Tags" msgstr "" -#: inc/saved-links/class-saved-links.php:113 +#: inc/saved-links/class-saved-links.php:122 msgid "Saved Link Tag" msgstr "" -#: inc/saved-links/class-saved-links.php:127 +#: inc/saved-links/class-saved-links.php:136 msgid "Link Information" msgstr "" -#: inc/saved-links/class-saved-links.php:171 +#: inc/saved-links/class-saved-links.php:180 msgid "Description:" msgstr "" -#: inc/saved-links/class-saved-links.php:181 +#: inc/saved-links/class-saved-links.php:190 msgid "Source:" msgstr "" -#: inc/saved-links/class-saved-links.php:186 +#: inc/saved-links/class-saved-links.php:195 msgid "Import featured image:" msgstr "" -#: inc/saved-links/class-saved-links.php:189 +#: inc/saved-links/class-saved-links.php:198 msgid "Import as feature image" msgstr "" -#: inc/saved-links/class-saved-links.php:262 +#: inc/saved-links/class-saved-links.php:271 msgid "Link Title" msgstr "" -#: inc/saved-links/class-saved-links.php:263 +#: inc/saved-links/class-saved-links.php:272 msgid "Author" msgstr "" -#: inc/saved-links/class-saved-links.php:264 +#: inc/saved-links/class-saved-links.php:273 msgid "URL" msgstr "" -#: inc/saved-links/class-saved-links.php:265 +#: inc/saved-links/class-saved-links.php:274 msgid "Description" msgstr "" -#: inc/saved-links/class-saved-links.php:266 +#: inc/saved-links/class-saved-links.php:275 msgid "Tags" msgstr "" -#: inc/saved-links/class-saved-links.php:267 +#: inc/saved-links/class-saved-links.php:276 msgid "Date" msgstr "" -#: inc/saved-links/class-saved-links.php:316 -#: inc/saved-links/class-saved-links.php:317 +#: inc/saved-links/class-saved-links.php:325 +#: inc/saved-links/class-saved-links.php:326 msgid "Add Browser Bookmark" msgstr "" -#: inc/saved-links/class-saved-links.php:337 +#: inc/saved-links/class-saved-links.php:346 msgid "Add Save to Site Bookmark to Your Web Browser" msgstr "" -#: inc/saved-links/class-saved-links.php:342 -#: inc/saved-links/class-saved-links.php:353 +#: inc/saved-links/class-saved-links.php:351 +#: inc/saved-links/class-saved-links.php:362 msgid "Save to Site" msgstr "" -#: inc/saved-links/class-saved-links.php:343 +#: inc/saved-links/class-saved-links.php:352 msgid "" "Save to Site is a tool that lets you send Saved Links to your WordPress " "Dashboard while browsing the web." msgstr "" -#: inc/saved-links/class-saved-links.php:344 +#: inc/saved-links/class-saved-links.php:353 msgid "" "Click the Save to Site bookmark and a new WordPress window will popup, " "attempting to prefill Title, URL and Source information." msgstr "" -#: inc/saved-links/class-saved-links.php:348 +#: inc/saved-links/class-saved-links.php:357 msgid "Install Save to Site" msgstr "" -#: inc/saved-links/class-saved-links.php:349 +#: inc/saved-links/class-saved-links.php:358 msgid "Browser Bookmarklet" msgstr "" -#: inc/saved-links/class-saved-links.php:350 +#: inc/saved-links/class-saved-links.php:359 msgid "" "Drag the Save to Site bookmarklet below to your web browser's Bookmarks " "Toolbar.
If you can't drag, click the Clipboard." msgstr "" -#: inc/saved-links/class-saved-links.php:356 +#: inc/saved-links/class-saved-links.php:365 msgid "Copy Save to Site bookmarklet code" msgstr "" -#: inc/saved-links/class-saved-links.php:362 +#: inc/saved-links/class-saved-links.php:371 msgid "" "If you can’t drag the bookmarklet to your bookmarks, copy the " "following code and create a new bookmark. Paste the code into the new " "bookmark’s URL field." msgstr "" -#: inc/saved-links/class-saved-links.php:369 +#: inc/saved-links/class-saved-links.php:378 msgid "Direct link (best for mobile and tablets)" msgstr "" -#: inc/saved-links/class-saved-links.php:370 +#: inc/saved-links/class-saved-links.php:379 msgid "" "Follow the link to open Save to Site. Then add it to your device’s " "bookmarks or home screen." msgstr "" -#: inc/saved-links/class-saved-links.php:373 +#: inc/saved-links/class-saved-links.php:382 msgid "Open Save to Site" msgstr "" -#: inc/saved-links/class-saved-links.php:632 inc/saved-links/widget.php:50 -msgid "Source: " -msgstr "" - #: inc/saved-links/class-wp-list-table-clone.php:143 msgid "List View" msgstr "" @@ -375,32 +406,6 @@ msgstr "" msgid "Select All" msgstr "" -#: inc/saved-links/widget.php:10 -msgid "Show your most recently saved links in a sidebar widget" -msgstr "" - -#: inc/saved-links/widget.php:12 -msgid "Saved Links Widget" -msgstr "" - -#: inc/saved-links/widget.php:60 -msgid "" -"

You don't have any recent links or the argo links " -"plugin is not active.

" -msgstr "" - -#: inc/saved-links/widget.php:82 -msgid "Recent Links" -msgstr "" - -#: inc/saved-links/widget.php:104 -msgid "Excerpt Length (# of Sentences):" -msgstr "" - -#: inc/saved-links/widget.php:111 -msgid "Show featured images?" -msgstr "" - #: inc/updates/index.php:115 #, php-format msgid "" @@ -507,10 +512,6 @@ msgstr "" msgid "Custom HTML for Displaying Links" msgstr "" -#: templates/options.php:15 -msgid "Mailchimp Integration" -msgstr "" - #: templates/options.php:22 msgid "You might call it a Daily Digest. Recap. Team Newsletter. Etc." msgstr "" @@ -595,41 +596,21 @@ msgid "" msgstr "" #: templates/options.php:87 -msgid "MailChimp Integration" +msgid "Save Changes" msgstr "" -#: templates/options.php:90 -msgid "Enable MailChimp Integration?" +#: vendor/inn/wordpress-mailchimp-tools/inc/admin/class-mailchimp-settings.php:44 +msgid "MailChimp API Settings" msgstr "" -#: templates/options.php:97 +#: vendor/inn/wordpress-mailchimp-tools/inc/admin/class-mailchimp-settings.php:50 msgid "MailChimp API Key" msgstr "" -#: templates/options.php:103 -msgid "Find your MailChimp API Key" +#: vendor/inn/wordpress-mailchimp-tools/templates/settings.php:2 +msgid "MailChimp Tools" msgstr "" -#: templates/options.php:105 -msgid "MailChimp Templates" -msgstr "" - -#: templates/options.php:112 -msgid "" -"Choose a MailChimp template to use as the basis for Link Roundup email " -"campaigns." -msgstr "" - -#: templates/options.php:115 -msgid "MailChimp Lists" -msgstr "" - -#: templates/options.php:122 -msgid "" -"Choose a MailChimp list that your Link Roundup email campaigns will be sent " -"to." -msgstr "" - -#: templates/options.php:127 -msgid "Save Changes" +#: vendor/inn/wordpress-mailchimp-tools/templates/settings.php:9 +msgid "Find your MailChimp API Key" msgstr "" diff --git a/link-roundups.php b/link-roundups.php index 4dd3765..bdc1e8d 100644 --- a/link-roundups.php +++ b/link-roundups.php @@ -5,7 +5,7 @@ Plugin URI: https://github.com/INN/link-roundups Description: Use Link Roundups to aggregate links and create roundup posts. Mailchimp API integration and browser bookmark tool. Formerly argo-links from NPR's Project Argo. Author: INN, Project Argo, Mission Data -Version: 0.3.2 +Version: 0.4.0 Author URI: http://nerds.inn.org/ License: GPLv2 diff --git a/package.json b/package.json index b8684b9..c06c5dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "link-roundups", - "version": "0.3.2", + "version": "0.4.0", "devDependencies": { "grunt": "~0.4.5", "grunt-contrib-less": "~0.12.0", diff --git a/release.sh b/release.sh index 6b33b44..f1f618e 100755 --- a/release.sh +++ b/release.sh @@ -1,122 +1,316 @@ -#!/bin/bash -RELEASE_DIR=release -SVN_PATH=$RELEASE_DIR/svn -SVN_REPO=https://plugins.svn.wordpress.org/link-roundups/ - -# which files go into the release? -GLOBIGNORE=* -WHITELIST=(LICENSE.txt package.json Gruntfile.js link-roundups.php contributing.md README.txt README.md css/* inc/* js/* lang/* less/* templates/* vendor/*) -BLACKLIST=(mkdocs.yml phpunit.xml requirements.txt docs/* node_modules/* tests/*) - -# check the state of this git repo -REMOTES=`git ls-remote --quiet` -CURRENT=`git rev-parse HEAD` -IS_MASTER=`echo "$REMOTES" | grep "refs/heads/master" | grep $CURRENT | awk '{print $2;}'` -IS_TAG=`echo "$REMOTES" | grep "refs/tags" | grep $CURRENT | awk '{print $2;}' | sed -e 's/^refs\/tags\///;s/\^{}$//'` -if [[ $IS_MASTER == "" && $IS_TAG == "" ]] -then - echo "WOH! Bad release state for git repo!" - echo "Make sure you've checked out a git-tag or latest-master before releasing." - exit 1 -fi +#!/usr/bin/env bash +RELEASE_DIR=release; +SVN_PATH=$RELEASE_DIR/svn; +SVN_REPO="https://plugins.svn.wordpress.org/link-roundups/"; +BLACKLIST=( +.\* +release.sh +mkdocs.yml +phpunit.xml +requirements.txt +composer.lock +composer.json +package.json +bower.json +Gruntfile.js +release/\* +tests/\* +node_modules/\* +); + +function ensure_release_dir() { + local release_dir="$1"; + if [[ ! -d $release_dir ]] + then + echo "Creating $release_dir directory"; + mkdir -p $release_dir; + fi +} + +function is_master_branch() { + local remotes=`git ls-remote --quiet`; + local current=`get_current_git_commit`; + local is_master=`echo "$remotes" | grep "refs/heads/master" | grep $current | awk '{print $2;}'`; + echo "$is_master"; +} + +function is_git_tag() { + local remotes=`git ls-remote --quiet`; + local current=`get_current_git_commit`; + local is_tag=`echo "$remotes" | grep "refs/tags" | grep $current | awk '{print $2;}' | sed -e 's/^refs\/tags\///;s/\^{}$//'`; + echo "$is_tag"; +} + +function get_current_git_commit() { + echo `git rev-parse HEAD`; +} + +function check_repo_state() { + # + # Check the state of this git repo. If no tag is checked out + # and we're not on the master branch, bail. + # + local is_master=`is_master_branch`; + local is_tag=`is_git_tag`; -# make sure we know what we're doing -WHICH_TEXT="[master] and [$(echo $IS_TAG)]" -if [[ $IS_MASTER == "" ]]; then WHICH_TEXT="[$(echo $IS_TAG)]"; fi -if [[ $IS_TAG == "" ]]; then WHICH_TEXT="[master]"; fi -read -p "Really release plugin from $WHICH_TEXT? " -n 1 -r -echo "" -echo "" -if [[ ! $REPLY =~ ^[Yy]$ ]] + if [[ "$is_master" == "" && "$is_tag" == "" ]] + then + echo "Bad release state for git repo!"; + echo "Make sure you've checked out a tag or the master branch before releasing."; + exit 1; + else + echo "Repository is ready for deployment..."; + fi +} + +function confirm_deployment() { + # make sure we know what we're doing + local is_master=`is_master_branch`; + local is_tag=`is_git_tag`; + local which_text="[master] and [$is_tag]"; + + if [[ $is_master == "" ]] + then + which_text="[$is_tag]"; + fi + + if [[ $is_tag == "" ]] + then + which_text="[master]"; + fi + + read -p "Really release plugin from $which_text? [y/N] " -r; + if [[ ! $REPLY =~ ^[Yy]$ ]] + then + echo "No changes made. Exiting..."; + exit 0; + fi +} + +function init_update_svn_repo() { + local svn_path="$1"; + local svn_repo="$2"; + + if [[ "$svn_path" == "" || "$svn_repo" == "" ]] + then + echo "The svn_path and svn_repo arguments are required."; + exit 1; + fi + + # init and update svn repo + if [[ ! -d $svn_path ]] + then + echo " - checking out svn repo"; + OUT=`mkdir -p $svn_path && svn checkout $svn_repo $svn_path` + if [[ $? -ne 0 ]] + then + echo "$OUT"; + exit 1; + fi + else + echo " - updating svn repo"; + OUT=`cd $svn_path && svn update`; + if [[ $? -ne 0 ]] + then + echo "$OUT"; + exit 1; + fi + fi +} + +function create_release_zip() { + # Build a release zip file + echo "Creating release/wp-release.zip"; + + OUT=`rm -f release/wp-release.zip`; + OUT=`zip -x "${BLACKLIST[@]}" -q -r release/wp-release.zip .`; + + if [[ $? -ne 0 ]] + then + echo "$OUT"; + exit 1; + fi +} + +function install_update_dependencies() { + echo "Checking for third-party/vendor dependencies..."; + # If composer.json exists, run composer install + if [[ -f composer.json ]] + then + echo " - installing composer dependencies"; + composer install --no-dev; + fi + + # If package.json exists, run npm install + if [[ -f package.json ]] + then + echo " - installing npm dependencies"; + npm install; + fi + + # If bower.json exists, run bower install + if [[ -f bower.json ]] + then + echo " - installing bower dependencies"; + bower install; + fi +} + +function write_trunk() { + local svn_path="$1"; + local is_master=`is_master_branch`; + + if [[ $is_master != "" ]] + then + trunk_path=$svn_path/trunk; + echo "Writing to $trunk_path"; + + # overwrite with unzip + OUT=`rm -rf $trunk_path && unzip -o release/wp-release.zip -d $trunk_path`; + if [[ $? -ne 0 ]] + then + echo "$OUT"; + exit 1; + fi; + + # stage all changes (adds and removes) + OUT=`cd $trunk_path && svn st | grep '^\?' | awk '{print \$2}' | xargs svn add` # add all + if [[ $? -ne 0 ]] + then + echo "$OUT"; + exit 1; + fi + + OUT=`cd $trunk_path && svn st | grep '^\!' | awk '{print \$2}' | xargs svn rm` # remove all + if [[ $? -ne 0 ]] + then + echo "$OUT"; + exit 1; + fi + + # make sure something has changed besides the autoloader hashes + CHANGES=`cd $trunk_path && svn st | grep -v 'autoload\(_real\)\?\.php'` + if [[ $CHANGES == "" ]] + then + echo "There are no changes to commit for trunk."; + OUT=`cd $trunk_path && svn revert --recursive .`; + if [[ $? -ne 0 ]] + then + echo "$OUT"; + exit 1; + fi + else + echo "Committing $trunk_path (slow) ..."; + CURRENT=`get_current_git_commit`; + OUT=`cd $trunk_path && svn commit -m "update trunk to git $CURRENT"`; + if [[ $? -ne 0 ]] + then + echo "$OUT"; + exit 1; + fi + fi + fi +} + +function write_tag() { + local svn_path="$1"; + local is_tag=`is_git_tag`; + + if [[ $is_tag != "" ]] + then + WP_TAG=`echo $is_tag | sed -e 's/^v//'`; + TAG_PATH=$svn_path/tags/$WP_TAG; + echo "Writing to $TAG_PATH"; + + # overwrite with unzip + OUT=`rm -rf $TAG_PATH && unzip -o release/wp-release.zip -d $TAG_PATH`; + if [[ $? -ne 0 ]] + then + echo "$OUT"; + exit 1; + fi + + # TODO: set version numbers and/or ensure version numbers in plugin files are correct + + # stage all changes (adds and removes) + OUT=`cd $svn_path/tags && svn st | grep '^\?' | awk '{print \$2}' | xargs svn add`; # add all + if [[ $? -ne 0 ]] + then + echo "$OUT"; + exit 1; + fi + OUT=`cd $svn_path/tags && svn st | grep '^\!' | awk '{print \$2}' | xargs svn rm`; # remove all + if [[ $? -ne 0 ]] + then + echo "$OUT"; + exit 1; + fi + + # make sure something has changed besides the autoloader hashes + CHANGES=`cd $svn_path/tags && svn st | grep -v 'autoload\(_real\)\?\.php'`; + if [[ $CHANGES == "" ]] + then + echo "There are no changes to commit for $TAG_PATH"; + OUT=`cd $svn_path/tags && svn revert --recursive .`; + if [[ $? -ne 0 ]] + then + echo "$OUT"; + exit 1; + fi + else + echo "Committing $TAG_PATH (slow) ..."; + CURRENT=`get_current_git_commit`; + OUT=`cd $svn_path/tags && svn commit -m "update $WP_TAG to git $CURRENT"`; + if [[ $? -ne 0 ]] + then + echo "$OUT"; + exit 1; + fi + fi + fi +} + +function help_text() { + echo "Usage: ./release.sh [--dry_run, --help]"; + echo ""; + echo "--dry_run: Create the release directory and release zip, + but bon't actually commit to the SVN repository." + echo ""; + echo "--help: Display this help screen and exit."; + echo ""; + exit 0; +} + +# Parse args +if [[ $@ =~ "help" || $@ =~ "--help" ]] then - echo "(no changes made)" - echo "" - exit 0 + help_text; fi -# init and update svn repo -if [[ ! -d $SVN_PATH ]] +if [[ $@ =~ "dry_run" || $@ =~ "--dry_run" ]] then - echo " - checking out svn repo" - OUT=`mkdir -p $SVN_PATH && svn checkout $SVN_REPO $SVN_PATH` - if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi + dry_run=1; else - echo " - updating svn repo" - OUT=`cd $SVN_PATH && svn update` - if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi + dry_run=0; fi -# (2) build zip -echo " - zipping up release/wp-release.zip" -OUT=`rm -f release/wp-release.zip` -OUT=`zip -r release/wp-release.zip . --include ${WHITELIST[@]} --exclude ${BLACKLIST[@]} -q` -if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi +# Start the release process +ensure_release_dir "$RELEASE_DIR"; +check_repo_state; +confirm_deployment; -# (3) optionally write to /svn/trunk -if [[ $IS_MASTER != "" ]] +if [[ $dry_run == 0 ]] then - TRUNK_PATH=$SVN_PATH/trunk - - # overwrite with unzip - echo " - writing to $TRUNK_PATH" - OUT=`rm -rf $TRUNK_PATH && unzip -o release/wp-release.zip -d $TRUNK_PATH` - if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi - - # stage all changes (adds and removes) - OUT=`cd $TRUNK_PATH && svn st | grep '^\?' | awk '{print \$2}' | xargs svn add` # add all - if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi - OUT=`cd $TRUNK_PATH && svn st | grep '^\!' | awk '{print \$2}' | xargs svn rm` # remove all - if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi - - # make sure something has changed besides the autoloader hashes - CHANGES=`cd $TRUNK_PATH && svn st | grep -v 'autoload\(_real\)\?\.php'` - if [[ $CHANGES == "" ]] - then - echo " no changes to commit for trunk" - OUT=`cd $TRUNK_PATH && svn revert --recursive .` - if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi - else - echo " - committing $TRUNK_PATH (slow) ..." - OUT=`cd $TRUNK_PATH && svn commit -m "update trunk to git $CURRENT"` - if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi - fi + init_update_svn_repo "$SVN_PATH" "$SVN_REPO"; fi -# (4) optionally write to /svn/tags/0.0.0 -if [[ $IS_TAG != "" ]] +install_update_dependencies; +create_release_zip; + +if [[ $dry_run == 0 ]] then - WP_TAG=`echo $IS_TAG | sed -e 's/^v//'` - TAG_PATH=$SVN_PATH/tags/$WP_TAG - - # overwrite with unzip - echo " - writing to $TAG_PATH" - OUT=`rm -rf $TAG_PATH && unzip -o release/wp-release.zip -d $TAG_PATH` - if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi - - # set the version - echo " - updating link-roundups.php version to $WP_TAG" - OUT=`sed "s/\* Version:.*$/* Version: $WP_TAG/" $TAG_PATH/link-roundups.php > link-roundups.php.new && mv link-roundups.php.new $TAG_PATH/link-roundups.php` - if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi - - # stage all changes (adds and removes) - OUT=`cd $SVN_PATH/tags && svn st | grep '^\?' | awk '{print \$2}' | xargs svn add` # add all - if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi - OUT=`cd $SVN_PATH/tags && svn st | grep '^\!' | awk '{print \$2}' | xargs svn rm` # remove all - if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi - - # make sure something has changed besides the autoloader hashes - CHANGES=`cd $SVN_PATH/tags && svn st | grep -v 'autoload\(_real\)\?\.php'` - if [[ $CHANGES == "" ]] - then - echo " no changes to commit for $TAG_PATH" - OUT=`cd $SVN_PATH/tags && svn revert --recursive .` - if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi - else - echo " - committing $TAG_PATH (slow) ..." - OUT=`cd $SVN_PATH/tags && svn commit -m "update $WP_TAG to git $CURRENT"` - if [[ $? -ne 0 ]]; then echo "$OUT" && exit 1; fi - fi + write_trunk "$SVN_PATH"; + write_tag "$SVN_PATH"; fi -# success -echo "and we're done!" +echo "Release process finished." diff --git a/tests/inc/lroundups/test-class-link-roundups.php b/tests/inc/lroundups/test-class-link-roundups.php index 846c7bb..2e4b88d 100644 --- a/tests/inc/lroundups/test-class-link-roundups.php +++ b/tests/inc/lroundups/test-class-link-roundups.php @@ -25,11 +25,11 @@ function test_init() { '`LinkRoundups::init` returns null and uses only core WordPress functions.'); } - function test_my_get_posts() { + function test_lr_get_posts() { $test_query = new WP_Query(); $test_query->is_home = true; - LinkRoundups::my_get_posts($test_query); + LinkRoundups::lr_get_posts($test_query); $this->assertTrue( in_array('roundup', $test_query->query_vars['post_type'])); @@ -79,11 +79,6 @@ function test_register_mysettings() { '`LinkRoundups::register_mysettings` returns null and uses only core WordPress functions.'); } - function test_validate_mailchimp_integration() { - $ret = LinkRoundups::validate_mailchimp_integration('test'); - $this->assertEquals($ret, ''); - } - function test_build_lroundups_options_page() { $this->markTestSkipped('This test has not been implemented yet.'); } diff --git a/tests/test-link-roundups.php b/tests/test-link-roundups.php index befd615..51b4b8c 100644 --- a/tests/test-link-roundups.php +++ b/tests/test-link-roundups.php @@ -24,38 +24,6 @@ function tearDown() { wp_reset_postdata(); } - function test_lroundups_activation() { - lroundups_activation(); - $this->assertTrue(get_transient('lroundups_flush')); - } - - function test_lroundups_deactivation() { - lroundups_activation(); - lroundups_deactivation(); - // this isn't working with transients seemingly, however did w/ options... - $this->assertFalse(get_transient('lroundups_flush')); - // $this->markTestIncomplete('Transients weren\'t testing well see code comment.'); - - } - - function test_lroundups_flush_permalinks() { - global $wp_rewrite; - - lroundups_activation(); - $ret = lroundups_flush_permalinks(); - - // Testing when it should run - $this->assertFalse( - get_transient('lroundups_flush'), - "WordPress did not recycle the transient lroundups_flush in lroundups_flush_permalinks"); - $this->assertTrue($ret); - unset($ret); - - // Testing when it should not run - $ret = lroundups_flush_permalinks(); - $this->assertFalse($ret); - } - function test_link_roundups_enqueue_assets() { link_roundups_enqueue_assets();