Skip to content

Commit 0d37513

Browse files
authored
Merge pull request #29 from circuscode/develop
Develop
2 parents c4abae8 + feea198 commit 0d37513

File tree

10 files changed

+54
-21
lines changed

10 files changed

+54
-21
lines changed

.github/workflows/deploy-env-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
username: ${{ secrets.FTP_USER_GITHUBDEPLOY }}
1818
password: ${{ secrets.FTP_PASSWORD_GITHUBDEPLOY }}
1919
protocol: ftp
20-
server-dir: unmus/dev/wordpress/wp-content/plugins/hello-dolly-for-your-song/
20+
server-dir: ${{ vars.FTP_PATH_DEV }}
2121
exclude: |
2222
**/.git*
2323
**/.git*/**

.github/workflows/deploy-env-public.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
username: ${{ secrets.FTP_USER_GITHUBDEPLOY }}
1818
password: ${{ secrets.FTP_PASSWORD_GITHUBDEPLOY }}
1919
protocol: ftp
20-
server-dir: unmus/public/wordpress/wp-content/plugins/hello-dolly-for-your-song/
20+
server-dir: ${{ vars.FTP_PATH_PUBLIC }}
2121
exclude: |
2222
**/.git*
2323
**/.git*/**

hdfys_display.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function hdfys_where_am_i() {
5151
global $pagenow;
5252

5353
// Run on specific pages only
54-
if ( $pagenow == 'index.php' OR $pagenow == 'edit.php' OR $pagenow == 'upload.php' OR $pagenow == 'edit-comments.php' OR $pagenow == 'post.php') {
54+
if ( $pagenow == 'index.php' OR $pagenow == 'edit.php' OR $pagenow == 'edit-comments.php' OR $pagenow == 'post.php') {
5555

5656
// Get Post Type
5757
if (isset($_GET['post_type'])) {

hdfys_installation.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ function hdfys_activate () {
2626
/* Initialize Settings */
2727
add_option('hdfys_activated',"1");
2828
add_option('hdfys_song',"");
29-
add_option('hdfys_version', "17");
29+
add_option('hdfys_version', "18");
3030
add_option('widget_hdfys_widget');
3131
add_option('hdfys_admin_lyric',"1");
3232
add_option('hdfys_text_updated',"0");
3333
}
3434
}
35-
register_activation_hook( __FILE__ , 'hdfys_activate' );
3635

3736
/**
3837
* Deactivate the plugin.
@@ -43,6 +42,5 @@ function hdfys_activate () {
4342
function hdfys_deactivate () {
4443
// nothing to do
4544
}
46-
register_deactivation_hook( __FILE__ , 'hdfys_deactivate' );
4745

4846
?>

hdfys_random.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,13 @@ function hdfys_get_hello_dolly() {
8989

9090
function hdfys_random_line ($text) {
9191
$text = explode( "\n", $text );
92-
return wptexturize( $text[ mt_rand( 0, count( $text ) - 1 ) ] );
92+
$text = wptexturize( $text[ mt_rand( 0, count( $text ) - 1 ) ] );
93+
94+
// If the last character of the line is blank, remove it
95+
$lastchar = substr($text, -1);
96+
if($lastchar == ' ') {$text = rtrim($text, " ");}
97+
98+
return $text;
9399
}
94100

95101
/**
@@ -105,12 +111,12 @@ function hdfys_get_anything () {
105111
// Get Custom Text
106112
$text = get_option('hdfys_song');
107113

108-
// If Length=0 then no text is maintained
114+
// If Length=0 > No text is maintained
109115
$text = strlen($text);
110116

111117
// Decide which text to take
112118
$line = ($text > 0) ? hdfys_get_lyric() : hdfys_get_hello_dolly() ;
113-
119+
114120
return $line;
115121
}
116122

hdfys_settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function hdfys_validate_songtext ( $songtext ) {
105105
*/
106106

107107
function hdfys_show_options() {
108-
add_options_page('Hello Dolly For Your Song', 'Hello Dolly Your Song', 10, basename(__FILE__), "hdfys_options");
108+
add_options_page('Hello Dolly For Your Song', 'Hello Dolly Your Song', 'manage_options', basename(__FILE__), "hdfys_options");
109109
}
110110
add_action( 'admin_menu', 'hdfys_show_options');
111111

hdfys_update.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function hdfys_update () {
2424
$hdfys_previous_version = get_option('hdfys_version');
2525

2626
/* Update Process Version 0.7 */
27-
if($hdfys_previous_version==false) {
27+
if($hdfys_previous_version==false) {
2828
add_option('hdfys_activated',"1");
2929
add_option('hdfys_version', "7");
3030
$lyrics = get_option('hdfys_song');
@@ -73,7 +73,11 @@ function hdfys_update () {
7373
if($hdfys_previous_version==16) {
7474
update_option('hdfys_version','17');
7575
}
76-
76+
/* Update Process Version 0.18 */
77+
if($hdfys_previous_version==17) {
78+
update_option('hdfys_version','18');
79+
}
80+
7781
}
7882
add_action( 'plugins_loaded', 'hdfys_update' );
7983

hellodollyforyoursong.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: Hello Dolly For Your Song
55
Plugin URI: https://www.unmus.de/wordpress-plugin-hello-dolly-for-your-song/
66
Description: This simple plugin shows a random line of any text in your blog.
7-
Version: 0.17
7+
Version: 0.18
88
Author: Marco Hitschler
99
Author URI: https://www.unmus.de/
1010
License: GPL3
@@ -37,6 +37,13 @@
3737
require_once('hdfys_sitehealth.php');
3838
require_once('hdfys_api.php');
3939

40+
/**
41+
* Installation & Deactivation
42+
*/
43+
44+
register_activation_hook( __FILE__ , 'hdfys_activate' );
45+
register_deactivation_hook( __FILE__ , 'hdfys_deactivate' );
46+
4047
/**
4148
* Add the settings link on the plugin page.
4249
*

readme.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ The filter will be applied before output of the gutenberg block, template tag an
6666

6767
This is Hello Dolly by Louis Armstrong. If no text is maintained in the options, the programm uses the songtext of Hello Dolly.
6868

69-
### How can I use the gutenberg block?
69+
### Where do I find the gutenberg block?
7070

71-
Just add the block in your content. You find the block in the category "widgets".
71+
You find the block in the category "widgets".
7272

7373
### How can I use the shortcode?
7474

@@ -122,8 +122,8 @@ This repository follows the git-flow workflow.
122122
* develop branch is the current state of development
123123
* feature branches contain dedicated features in development
124124
* bugfix branches contain dedicated bugfixes in development
125-
* hotfix branches contain dedicated bugfixes in development
126-
* release branches contain the next release in preparation
125+
126+
Hotfix and release branches will not be applied.
127127

128128
## Unterstanding the Deployment
129129

@@ -153,6 +153,14 @@ This project is licensed under the GPL3 License.
153153

154154
## Changelog
155155

156+
### 0.18
157+
158+
* april 2023
159+
* Bugfix: LastChar is blank
160+
* Bugfix: Installation Process
161+
* Changed: Page Uploads excluded
162+
* Others: Depreciated Authorization replaced
163+
156164
### 0.17
157165

158166
* may 2020

readme.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Contributors: unmus, jordansilaen
33
Tags: hello world, love, random, learning wordpress, admin
44
Requires at least: 4.4
55
Requires PHP: 7.0
6-
Tested up to: 5.4.1
7-
Stable tag: 0.17
6+
Tested up to: 6.2
7+
Stable tag: 0.18
88
License: GPLv3 or later
99
License URI: https://www.gnu.org/licenses/gpl-3.0.html
1010

@@ -47,9 +47,9 @@ This simple plugin is an extended version of the famous hello dolly plugin by Ma
4747

4848
This is Hello Dolly by Louis Armstrong. If no text is maintained in the options, the programm uses the songtext of Hello Dolly.
4949

50-
= How can I use the gutenberg block? =
50+
= Where do I find the gutenberg block? =
5151

52-
Just add the block in your content. You find the block in the category "widgets".
52+
You find the block in the category "widgets".
5353

5454
= How can I use the shortcode? =
5555

@@ -101,6 +101,13 @@ Several admin pages like settings are excluded, because some plugins do not use
101101

102102
== Changelog ==
103103

104+
= 0.18 =
105+
* april 2023
106+
* Bugfix: LastChar is blank
107+
* Bugfix: Installation Process
108+
* Changed: Page Uploads excluded
109+
* Others: Depreciated Authorization replaced
110+
104111
= 0.17 =
105112
* may 2020
106113
* Russian Translation
@@ -196,6 +203,9 @@ Several admin pages like settings are excluded, because some plugins do not use
196203

197204
== Upgrade Notice ==
198205

206+
= 0.18 =
207+
This version is a maintenance release (no new features, but bugfixes).
208+
199209
= 0.17 =
200210
This version brings russian translation.
201211

0 commit comments

Comments
 (0)