diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a9166e400919ee66468366d3d72dda5e6a2bc899 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# ETH Simple Shortlinks # +**Contributors:** ethitter +**Donate link:** https://ethitter.com/donate/ +**Tags:** seo, meta tags +**Requires at least:** 4.4 +**Tested up to:** 5.2 +**Stable tag:** 0.5 +**License:** GPLv2 or later +**License URI:** http://www.gnu.org/licenses/gpl-2.0.html + +Convert WordPress's query-based shortlinks to pretty permalinks that are cacheable. http://example.com/?p=123 becomes http://example.com/p/123/. + +## Description ## + +WordPress 3.0 introduced a native shortlinks feature, which builds URLs using query strings. This plugin converts those URLs to ones using pretty permalinks, which makes for a nicer-looking URL and improves shortlinks' ability to be cached. + +Posts and pages are supported by default, while filters make it possible to support other post types. + +For example, http://example.com/?p=123 becomes http://example.com/p/123/. + +## Installation ## + +1. Upload the plugin files to the `/wp-content/plugins/eth-simple-shortlinks` directory, or install the plugin through the WordPress plugins screen directly. +1. Activate the plugin through the 'Plugins' screen in WordPress. +1. Flush your site's rewrite rules by visiting Settings > Permalinks. + +## Frequently Asked Questions ## + +### Can I customize a shortlink? ### + +No, shortlinks use the posts' IDs, so aren't available for modification. + +## Changelog ## + +### 0.5 ### +* Admin notices when permalinks won't support the plugin +* Disable plugin functionality when permalink structure is incompatible +* Translation support + +### 0.4 ### +* Initial release diff --git a/eth-simple-shortlinks.php b/eth-simple-shortlinks.php index a67b05c9d904b335aa9694bed9cb7f96b545d292..381f07d0915d3884d4b50ff4aca5348c4495181a 100644 --- a/eth-simple-shortlinks.php +++ b/eth-simple-shortlinks.php @@ -48,8 +48,8 @@ class ETH_Simple_Shortlinks { /** * Dummy magic methods */ - public function __clone() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ uh?' ), '0.1' ); } - public function __wakeup() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ uh?' ), '0.1' ); } + public function __clone() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ uh?', 'eth_simple_shortlinks' ), '0.1' ); } + public function __wakeup() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ uh?', 'eth_simple_shortlinks' ), '0.1' ); } public function __call( $name = '', $args = array() ) { unset( $name, $args ); return null; } /** @@ -248,7 +248,7 @@ class ETH_Simple_Shortlinks { return $actions; } - $actions['shortlink'] = '<a href="' . esc_js( $this->get_shortlink( $post->ID ) ) . '">' . __( 'Shortlink' ) . '</a>'; + $actions['shortlink'] = '<a href="' . esc_js( $this->get_shortlink( $post->ID ) ) . '">' . __( 'Shortlink', 'eth_simple_shortlinks' ) . '</a>'; return $actions; } diff --git a/languages/.gitkeep b/languages/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/languages/eth-simple-shortlinks.pot b/languages/eth-simple-shortlinks.pot new file mode 100644 index 0000000000000000000000000000000000000000..bf9b3a5f7cec79430b85db643333b98b4e8b850a --- /dev/null +++ b/languages/eth-simple-shortlinks.pot @@ -0,0 +1,76 @@ +# Copyright (C) 2019 Erick Hitter +# This file is distributed under the same license as the ETH Simple Shortlinks package. +msgid "" +msgstr "" +"Project-Id-Version: ETH Simple Shortlinks 0.5\n" +"Report-Msgid-Bugs-To: " +"https://wordpress.org/support/plugin/eth-simple-shortlinks\n" +"POT-Creation-Date: 2019-04-14 04:31:11+00:00\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"X-Generator: grunt-wp-i18n 0.5.4\n" +"X-Poedit-KeywordsList: " +"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_" +"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-Country: United States\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-Basepath: ../\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-Bookmarks: \n" +"X-Textdomain-Support: yes\n" + +#: eth-simple-shortlinks.php:51 eth-simple-shortlinks.php:52 +msgid "Cheatin’ uh?" +msgstr "" + +#: eth-simple-shortlinks.php:138 +msgid "" +"Please visit the <a href=\"%1$s\">Permalinks</a> settings page to refresh " +"your permalinks. Doing so will add the rules this plugin requires." +msgstr "" + +#: eth-simple-shortlinks.php:141 +msgid "" +"Please enable <a href=\"%1$s\">pretty permalinks</a>, otherwise disable " +"this plugin as it is not compatible with \"Plain\" permalinks." +msgstr "" + +#: eth-simple-shortlinks.php:146 +msgid "<strong>%1$s</strong>: %2$s" +msgstr "" + +#: eth-simple-shortlinks.php:251 +msgid "Shortlink" +msgstr "" + +#: eth-simple-shortlinks.php:293 +msgid "" +"Shortlinks cannot be generated until after <code>wp_loaded</code>; this " +"ensures that all post types are registered." +msgstr "" + +#. Plugin Name of the plugin/theme +msgid "ETH Simple Shortlinks" +msgstr "" + +#. Plugin URI of the plugin/theme +msgid "https://ethitter.com/plugins/" +msgstr "" + +#. Description of the plugin/theme +msgid "Simple non-GET shortlinks using post IDs" +msgstr "" + +#. Author of the plugin/theme +msgid "Erick Hitter" +msgstr "" + +#. Author URI of the plugin/theme +msgid "https://ethitter.com/" +msgstr "" \ No newline at end of file