Skip to content

Commit 97f0e81

Browse files
committed
fix: updated based on WP feedback
1 parent fbb61d0 commit 97f0e81

File tree

4 files changed

+40
-30
lines changed

4 files changed

+40
-30
lines changed
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#!/bin/bash
2-
#build the web-component
3-
npx nx build web-component
42
# delete previous version
5-
rm -rf packages/web-component/wordpress-plugin/read-along-web-app-loader/js/*
63
rm -rf packages/web-component/wordpress-plugin/read-along-web-app-loader.zip
7-
#add build to plugin and make zip
8-
cp dist/packages/web-component/dist/web-component/* packages/web-component/wordpress-plugin/read-along-web-app-loader/js/
94
cd packages/web-component/wordpress-plugin/
105
zip a -r ./read-along-web-app-loader.zip ./read-along-web-app-loader
Binary file not shown.

packages/web-component/wordpress-plugin/read-along-web-app-loader/read-along-web-app-loader.php

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Plugin Name: Read-Along Web App Loader
1313
* Plugin URI: https://github.com/ReadAlongs/Studio-Web/
1414
* Description: This plugin loads the script and styles needed to activate the <read-along> tag in a Word Press site
15-
* Version: 1.3.0
15+
* Version: 1.3.2
1616
* Author: Delasie Torkornoo
1717
* License: MIT
1818
* License URI: https://github.com/ReadAlongs/Studio-Web/blob/main/LICENSE
@@ -26,7 +26,7 @@
2626
/**
2727
* Currently plugin version.
2828
*/
29-
define("Read_Along_Web_App_Loader_VERSION", "1.3.0");
29+
define("Read_Along_Web_App_Loader_VERSION", "1.3.2");
3030
define("Read_Along_Web_App_VERSION", "1.3.0");
3131
class ReadAlongWebAppLoader
3232
{
@@ -36,25 +36,34 @@ class ReadAlongWebAppLoader
3636
* Accepts version of read-along generated
3737
*/
3838

39-
public static function short_code($attrs = [], $content = null)
39+
public static function short_code($attrs = [], $content = null, $tag = "")
4040
{
4141
$output = "";
42-
wp_enqueue_style(
43-
"Read_Along_Web_App_Loader_Font",
44-
"https://fonts.googleapis.com/css?family=Lato%7CMaterial+Icons%7CMaterial+Icons+Outlined",
45-
[],
46-
Read_Along_Web_App_Loader_VERSION
42+
// normalize attribute keys, lowercase
43+
$attrs = array_change_key_case((array) $attrs, CASE_LOWER);
44+
$attributes = shortcode_atts(
45+
[
46+
"version" => Read_Along_Web_App_VERSION,
47+
],
48+
$attrs,
49+
$tag
4750
);
51+
52+
if (!is_null($content)) {
53+
$output = apply_filters("the_content", $content);
54+
}
55+
56+
$src = sprintf(
57+
"https://unpkg.com/@readalongs/web-component@%s/dist/web-component/web-component.esm.js",
58+
$attributes["version"]
59+
);
60+
//script source code https://github.com/ReadAlongs/Studio-Web/
4861
wp_enqueue_script_module(
4962
"read_along_web_component_script",
50-
plugin_dir_url(__FILE__) . "js/web-component.esm.js",
63+
$src,
5164
[],
5265
Read_Along_Web_App_VERSION
5366
);
54-
if (!is_null($content)) {
55-
$output = apply_filters("the_content", $content);
56-
}
57-
5867
return $output;
5968
}
6069
/**

packages/web-component/wordpress-plugin/read-along-web-app-loader/readme.txt

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,26 @@ Contributors: deltork
33
Tags: read-along, read along, web app loading
44
Requires at least: 6.5.0
55
Tested up to: 6.5.2
6-
Stable tag: 1.3.0
6+
Stable tag: 1.3.2
77
Requires PHP: 7.0
88
License: MIT
9-
License URI: https://github.com/ReadAlongs/Studio-Web/blob/main/LICENSE
9+
License URI: GPLv2 or later
1010

1111
This WordPress plugin allows the deployment and activation of a Read-Along generated using https://github.com/ReadAlongs/ on WordPress sites.
1212

1313

1414
== Description ==
15-
This plugin loads the script and styles needed to activate the <read-along> tag in a Word Press site.
16-
This WordPress plugin allows the deployment and activation of a Read-Along generated using https://github.com/ReadAlongs/ on WordPress sites. Just wrap your `<read-along>` in a WordPress shortcode `[read_along_web_app_loader]`. The plugin does not load the script on all pages on your site; it will only add the script to the pages with the shortcode.
15+
16+
This plugin is a free service (no account required) for activating the &lt;read-along&gt; tag in a WordPress site. The source code of the scripts used to activate the &lt;read-along&gt; tag is https://github.com/ReadAlongs/Studio-Web/.
17+
This plugin will help you deploy and activate a Read-Along generated using **Studio-Web** or **Studio-CLI** from https://github.com/ReadAlongs/ on your WordPress site.
18+
Please copy and paste the HTML code from the WordPress deployment section of the readme.txt generated by our studio application. Alternatively, just wrap your `<read-along>` in a WordPress shortcode `[read_along_web_app_loader]`.
19+
1720
The shortcode accepts one optional attribute:
18-
- The `version` attribute for which version of the read-along generator
21+
- The `version` attribute for which version of the read-along web app to use
1922

2023
== Frequently Asked Questions ==
2124

22-
= How to get the code required for my read along =
25+
= How to get the code required for my read-along =
2326

2427
Copy the code from the WordPress deployment section of the readme.txt
2528

@@ -29,16 +32,19 @@ There are two ways to generate a read-along. The online web app (download the we
2932

3033
== Screenshots ==
3134

32-
1. Configure read-along web app component in your WordPress classic editor
35+
1. Configure the read-along web app component in your WordPress classic editor
3336
2. Sample read-along book
34-
3. Configure read-along web app component in your WordPress block editor
37+
3. Configure the read-along web app component in your WordPress block editor
3538

3639
== Changelog ==
37-
= 1.3.0=
38-
* Embedded the ReadAlong app scripts
40+
= 1.3.2 =
41+
* Code updates
3942
= 1.0.0 =
4043
* Initial Release
4144

42-
43-
4445
== Upgrade Notice ==
46+
= 1.3.2 =
47+
Bumped default read-along app version to 1.3.0
48+
49+
== Contributing ==
50+
The ReadAlong is an open-source project. You can make a Pull-Request to our repo at https://github.com/ReadAlongs/Studio-Web/

0 commit comments

Comments
 (0)