Skip to content

Commit 85b41e8

Browse files
committed
FAQ added , Version update, code fixed
1 parent 06b44f5 commit 85b41e8

File tree

6 files changed

+57
-26
lines changed

6 files changed

+57
-26
lines changed

FAQ.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Codehaveli Bitly URL Shortener
2+
3+
## Frequently Asked Questions
4+
5+
### How to get the short link of a post?
6+
7+
```
8+
$link = get_wbitly_short_url($post_id); // link or false
9+
10+
```
11+
12+
### How to generate shortlink of a link?
13+
14+
```
15+
$short_link = wbitly_generate_shorten_url($long_link); // link or false
16+
```
17+
18+
### How can i change the URL before the shorten process?
19+
20+
```
21+
add_filter('wbitly_url_before_process' , 'modify_permalink_of_post' , 10 , 1);
22+
function modify_permalink_of_post($permalink){
23+
return $permalink;
24+
}
25+
26+
```
27+
28+
You can use `wbitly_url_before_process` filter to change the URL/Permalink. Call back function accepts the permalink.
29+
30+
### How can i hook into the generated URL?
31+
32+
```
33+
add_action('wbitly_shorturl_updated' , 'post_to_other' , 10 , 1);
34+
function post_to_other($url){
35+
// do anything with $url
36+
}
37+
```
38+
39+
We can use the hook to do get the short url and use it accordingly

README.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
1-
21
<p align="center">
32
<img src="sc/banner-1544x500.png?raw=true">
43
</p>
54

6-
# Codehaveli Bitly URL Shortener
5+
# Codehaveli Bitly URL Shortener
76

87
### Description
98

10-
[Codehaveli Bitly URL Shortener](https://wordpress.org/plugins/codehaveli-bitly-url-shortener/) allow you to connect your WordPress Website to the https://bitly.com/ account via access code.
11-
12-
This Plugin enables Bitly User to generate short link automatically from Wordpress when they publish new post.
13-
14-
This plugin use the functionality of **Bitly API** and generate short link and also get your group Guid from your Bitly account [During Your Settings ].
15-
16-
9+
[Codehaveli Bitly URL Shortener](https://wordpress.org/plugins/codehaveli-bitly-url-shortener/) uses the functionality of Bitly API to generate the short link automatically from your WordPress dashboard.
1710

11+
Codehaveli Bitly URL Shortener allows you to connect your WordPress Website to the Bitly API via access code.
1812

19-
### Terms of Use
13+
### Terms of Use
2014

2115
This is not a Official plugin of [Bitly](https://bitly.com)
2216

2317
This plugin only connect your [https://bitly.com](https://bitly.com) account to WordPress.
2418

2519
Please read [privacy](https://bitly.com/pages/privacy) and [terms of service](https://bitly.com/pages/terms-of-service) of [Bitly](https://bitly.com) before using this plugin.
2620

27-
28-
2921
### Bug reports
3022

3123
Bug reports for Codehaveli Bitly URL Shortener are welcomed in our Codehaveli Bitly URL Shortener [repository on GitHub](https://github.com/codehaveli/codehaveli-bitly-url-shortener). Please note that GitHub is not a support forum, and that issues that are not properly qualified as bugs will be closed.
@@ -34,9 +26,7 @@ Bug reports for Codehaveli Bitly URL Shortener are welcomed in our Codehaveli Bi
3426

3527
For more info on Bitly and Codehaveli , check out the following:
3628

37-
* [Codehaveli](https://bit.ly/2A8QyGt) official homepage.
38-
* Bitly Access Token Generate Process from [Codehaveli Blog](https://bit.ly/2X1Hvjz)
39-
* Bitly [API Documentation](https://bitly.is/2XxT9BN)
40-
* Follow Codehaveli on [Facebook](https://www.facebook.com/codehaveli), [Instagram](https://www.instagram.com/codehaveli/) & [Twitter](https://twitter.com/codehaveli).
41-
42-
29+
- [Codehaveli](https://www.codehaveli.com/) official homepage.
30+
- Read "How to generate Bitly OAuth access token" from [Codehaveli Blog](https://bit.ly/2X1Hvjz)
31+
- Bitly [API Documentation](https://bitly.is/2XxT9BN)
32+
- Follow Codehaveli on [Facebook](https://www.facebook.com/codehaveli), [Instagram](https://www.instagram.com/codehaveli/) & [Twitter](https://twitter.com/codehaveli).

codehaveli-bitly-url-shortener.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: Codehaveli Bitly URL Shortener
55
Plugin URI: https://github.com/codehaveli/
66
Description: This Plugin is used for shorten the newly published post url, Plugin use the api functionality of https://bitly.com/ to achive this URL shorten process.
7-
Version: 1.1
7+
Version: 1.1.1
88
Author: Codehaveli
99
Author URI: https://www.codehaveli.com/
1010
License: GPLv2 or later
@@ -16,11 +16,13 @@
1616

1717
define( 'WBITLY_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
1818
define( 'WBITLY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
19-
define( 'WBITLY_PLUGIN_VERSION', '1.1' );
19+
define( 'WBITLY_PLUGIN_VERSION', '1.1.1' );
2020
define( 'WBITLY_API_URL', 'https://api-ssl.bitly.com' );
2121
define( 'WBITLY_BASENAME', plugin_basename( __FILE__ ) );
2222
define( 'WBITLY_SETTINGS_URL', admin_url( 'tools.php?page=wbitly' ) );
2323

24+
// https://raventools.com/marketing-reports/google-analytics/url-builder/?utm_source=Social%20Network&utm_medium=link&utm_campaign=Bitly&utm_term=Term&utm_content=Content
25+
2426

2527

2628

inc/wbitly-integration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @Last Modified by: Codehaveli
77
* @Website: www.codehaveli.com
88
* @Email: hello@codehaveli.com
9-
* @Last Modified time: 2020-06-29 20:03:48
9+
* @Last Modified time: 2020-06-30 19:03:04
1010
*/
1111

1212

@@ -83,7 +83,7 @@ function wbitly_generate_shorten_url($permalink){
8383

8484
function wbitly_shorten_url ($permalink) {
8585

86-
_deprecated_function( 'wbitly_shorten_url', '1.0.1', 'wbitly_generate_shorten_url' );
86+
_deprecated_function( 'wbitly_shorten_url', '1.1', 'wbitly_generate_shorten_url' );
8787

8888

8989
return wbitly_generate_shorten_url($permalink);

inc/wbitly-settings.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @Last Modified by: Codehaveli
77
* @Website: www.codehaveli.com
88
* @Email: hello@codehaveli.com
9-
* @Last Modified time: 2020-06-29 19:32:16
9+
* @Last Modified time: 2020-08-20 09:27:42
1010
*/
1111

1212

@@ -148,14 +148,14 @@ public function wbitly_get_bitly_guid_request($access_token){
148148

149149
$error = $http_response->get_error_message();
150150
$pluginlog = plugin_dir_path(__FILE__).'error.log';
151-
$message = $error .WBITLY_PLUGIN_VERSION .PHP_EOL;
151+
$message = $error . PHP_EOL;
152152
error_log($message, 3, $pluginlog);
153153
}
154154

155155
} catch (Exception $e) {
156156

157157
$pluginlog = plugin_dir_path(__FILE__).'debug.log';
158-
$message = 'Unable to get Bitly GUID This message was added in version '.WBITLY_PLUGIN_VERSION .PHP_EOL;
158+
$message = 'Unable to get Bitly GUID' . PHP_EOL;
159159
error_log($message, 3, $pluginlog);
160160
}
161161

inc/wbitly-util.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function wbitly_get_template( $template_name, $template_path = '', $default_path
8686
$located = wbitly_locate_template( $template_name, $template_path, $default_path );
8787

8888
if ( ! file_exists( $located ) ) {
89-
_doing_it_wrong( __FUNCTION__, sprintf( '<code>%s</code> does not exist.', esc_html( $located ) ), '1.0.1' );
89+
_doing_it_wrong( __FUNCTION__, sprintf( '<code>%s</code> does not exist.', esc_html( $located ) ), WBITLY_PLUGIN_VERSION );
9090
return;
9191
}
9292

0 commit comments

Comments
 (0)