Skip to content

Commit 733cd1e

Browse files
committed
Release 1.0.2
1 parent ad2cb6f commit 733cd1e

13 files changed

+109
-84
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ Download our contacts-to-leads plugin today. Learn more at <https://www.grocrm.c
1414

1515
License
1616
-------
17-
Copyright 2017 [Gro CRM](https://www.grocrm.com)
17+
Copyright 2018 [Gro CRM](https://www.grocrm.com)
1818

1919
Licensed under GPLv2 or later. Details in the license file.

README.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Contributors: grocrm
33
Tags: crm, contact, contacts, signup, marketing, leads, contact form, contact form plugin, Gro CRM, grocrm.com, secure form, web to lead, web to contact, crm forms, crm leads, lead, leads, lead tracking, form, forms
44
Requires at least: 4.7.3
5-
Tested up to: 4.7.3
6-
Stable tag: 1.0.1
5+
Tested up to: 4.9.6
6+
Stable tag: 1.0.2
77
License: GPLv2 or later
88
License URI: http://www.gnu.org/licenses/gpl-2.0.html
99

@@ -72,3 +72,7 @@ A. You can email us directly at "support@grocrm.com".
7272
* Minor API fixes
7373
* Description updates
7474

75+
= 1.0.2 =
76+
* Shortcode API compatibility fixes
77+
* Wordpress 4.9.6 Updates
78+

admin/css/grocrm-admin.css

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ body.grocrm-page #wpcontent {
5959

6060
.grocrm-body {
6161
width: 100%;
62-
background-color: #FDB12A;
62+
background-color: #22cbc0;
6363
}
6464

6565
/* Tabs */
@@ -80,7 +80,7 @@ body.grocrm-page #wpcontent {
8080
cursor: pointer;
8181
text-decoration: none;
8282
text-align: center;
83-
background-color: #A77418;
83+
background-color: #257da6;
8484
padding: 20px 30px;
8585
border-top-left-radius: 5px;
8686
border-top-right-radius: 5px;
@@ -127,7 +127,9 @@ body.grocrm-page #wpcontent {
127127
display: block;
128128
background-color: #272C31;
129129
margin: 0px;
130-
padding: 0px;
130+
padding-top: 20px;
131+
padding-bottom: 20px;
132+
background: linear-gradient(#2e759a, #22cbc0);
131133
}
132134

133135
.grocrm-header h1 {
@@ -136,7 +138,7 @@ body.grocrm-page #wpcontent {
136138
}
137139

138140
.grocrm-header h3 {
139-
color: #888b8d;
141+
color: #ffffff;
140142
font-weight: 200;
141143
text-align: center;
142144
}
-6.67 KB
Binary file not shown.

admin/images/gro_crm_logo.png

-1.14 KB
Binary file not shown.

admin/partials/grocrm-admin-display.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@
1313
*/
1414
?>
1515

16-
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
1716
<header class="grocrm-header">
18-
<img alt="Gro CRM Logo" height="80" src="<?php echo plugin_dir_url( __FILE__ ) . "../images/gro_crm_logo.png" ?>">
1917
<h1><?php esc_html_e( 'Contact-to-Leads', 'grocrm'); ?></h1>
2018
<h3 style="padding-bottom: 20px;"><?php esc_html_e( 'Convert Wordpress forms into Gro CRM leads', 'grocrm'); ?></h3>
21-
<div class="grocrm-background-analytic" style="height:50px;"></div>
22-
<div style="background-color: #FDB12A; width: 100%; height: 40px;"></div>
2319
</header>
2420

2521
<?php if ( !get_option("grocrm_api_key") || empty(get_option("grocrm_api_key"))) { ?>
@@ -147,7 +143,16 @@
147143
<label for="grocrm_default_tags"><?php esc_html_e('Default tags', 'grocrm'); ?></label>
148144
</div>
149145
<div class="grocrm-col-8">
150-
<input type="text" id="grocrm_default_tags" name="grocrm_default_tags" placeholder="ex. website,contact-form" value="<?php echo esc_attr(implode(",", get_option("grocrm_default_tags"))); ?>">
146+
<?php
147+
$tags = get_option("grocrm_default_tags");
148+
149+
if (empty($tags)) {
150+
$tags = [];
151+
}
152+
153+
$tagString = implode(",", $tags);
154+
?>
155+
<input type="text" id="grocrm_default_tags" name="grocrm_default_tags" placeholder="ex. website,contact-form" value="<?php echo esc_attr($tagString); ?>">
151156
<p><?php esc_html_e('Insert tags that you would like to be attached to these contacts. Comma separated. No spaces allowed.', 'grocrm'); ?></p>
152157
</div>
153158
</div>
@@ -167,6 +172,10 @@
167172

168173
<?php
169174
$grocrm_field_keys = get_option("grocrm_field_keys");
175+
176+
if (empty($grocrm_field_keys)) {
177+
$grocrm_field_keys = [];
178+
}
170179

171180
foreach (grocrm_fields() as $key => $value) {
172181

assets/banner-1544x500.jpg

-107 KB
Loading

assets/banner-772x250.jpg

-46.2 KB
Loading

assets/screenshot-2.png

15.5 KB
Loading

grocrm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Plugin Name: Gro CRM
1717
* Plugin URI: https://www.grocrm.com/developer/api/
1818
* Description: The Mac CRM sales platform designed for iOS and the Apple Small Business market. Use our Gro CRM Contact-to-Leads WordPress Plug-in for your website.
19-
* Version: 1.0.0
19+
* Version: 1.0.2
2020
* Author: Gro CRM
2121
* Author URI: https://www.grocrm.com/
2222
* License: GPL-2.0+

includes/class-grocrm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class Grocrm {
6969
public function __construct() {
7070

7171
$this->plugin_name = 'grocrm';
72-
$this->version = '1.0.0';
72+
$this->version = '1.0.2';
7373

7474
$this->load_dependencies();
7575
$this->set_locale();

public/class-grocrm-public.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ public function register_shortcodes() {
9696
}
9797

9898
public function form_shortcode($atts) {
99+
ob_start();
99100
include_once 'partials/grocrm-public-display.php';
101+
return ob_get_clean();
100102
}
101103

102104
public function validate_input() {
@@ -107,6 +109,10 @@ public function validate_input() {
107109
$field_keys = get_option("grocrm_field_keys");
108110
$phoneRegex = '/^[+]?([\d]{0,3})?[\(\.\-\s]?(([\d]{1,3})[\)\.\-\s]*)?(([\d]{3,5})[\.\-\s]?([\d]{4})|([\d]{2}[\.\-\s]?){4})$/';
109111

112+
if (empty($field_keys)) {
113+
$field_keys = [];
114+
}
115+
110116
foreach ($field_keys as $key) {
111117

112118
$label = $fields[$key]["label"];
@@ -151,6 +157,10 @@ public function request_handler() {
151157
$defaultType = get_option("grocrm_default_type", 3);
152158
$defaultTags = get_option("grocrm_default_tags");
153159

160+
if (empty($defaultTags)) {
161+
$defaultTags = null;
162+
}
163+
154164
$parameters = [
155165
"type_id" => $defaultType,
156166
"tags" => $defaultTags
@@ -183,7 +193,7 @@ public function request_handler() {
183193

184194
$parameters["notes"] = $notes;
185195
}
186-
196+
187197
$this->grocrm_success = true;
188198

189199
try {

public/partials/grocrm-public-display.php

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* @subpackage Grocrm/public/partials
1313
*/
1414
?>
15-
1615
<?php
1716

1817
$header = get_option("grocrm_header");
@@ -29,85 +28,86 @@
2928

3029
<form class="grocrm-form" method="post">
3130

32-
3331
<?php
32+
$fields = grocrm_fields();
33+
$field_keys = get_option("grocrm_field_keys");
34+
35+
if (empty($field_keys)) {
36+
$field_keys = ["grocrm_first_name", "grocrm_last_name", "grocrm_email_address"];
37+
}
38+
39+
foreach ($field_keys as $key) {
3440

35-
$fields = grocrm_fields();
36-
$field_keys = get_option("grocrm_field_keys");
41+
$label = $fields[$key]["label"];
42+
$required = $fields[$key]["required"];
43+
$input_type = $fields[$key]["input_type"];
3744

38-
foreach ($field_keys as $key) {
39-
40-
$label = $fields[$key]["label"];
41-
$required = $fields[$key]["required"];
42-
$input_type = $fields[$key]["input_type"];
43-
44-
if (isset($_POST[$key]) && $this->grocrm_success != true) {
45-
$value = stripslashes($_POST[$key]);
46-
} else {
47-
$value = "";
48-
}
49-
50-
echo "<div class=\"grocrm-field\">";
51-
52-
if ($required) {
53-
echo "<label for=\"$key\">$label*</label>";
54-
} else {
55-
echo "<label for=\"$key\">$label</label>";
56-
}
45+
if (isset($_POST[$key]) && $this->grocrm_success != true) {
46+
$value = stripslashes($_POST[$key]);
47+
} else {
48+
$value = "";
49+
}
50+
51+
echo "<div class=\"grocrm-field\">";
52+
53+
if ($required) {
54+
echo "<label for=\"$key\">$label*</label>";
55+
} else {
56+
echo "<label for=\"$key\">$label</label>";
57+
}
58+
59+
// Handle Input Field Types
60+
if (in_array($input_type, ["button", "checkbox", "color", "date", "datetime-local", "email", "file", "hidden", "image", "month", "number", "password", "radio", "range", "reset", "search", "submit", "tel", "text", "time", "url", "week"])) {
61+
echo "<input type=\"text\" id=\"$key\" name=\"$key\" value=\"".esc_html($value)."\">";
62+
}
63+
64+
if ($input_type == "select") {
5765

58-
// Handle Input Field Types
59-
if (in_array($input_type, ["button", "checkbox", "color", "date", "datetime-local", "email", "file", "hidden", "image", "month", "number", "password", "radio", "range", "reset", "search", "submit", "tel", "text", "time", "url", "week"])) {
60-
echo "<input type=\"text\" id=\"$key\" name=\"$key\" value=\"".esc_html($value)."\">";
66+
if ($key == "grocrm_country") {
67+
$optionArray = $this->grocrm_api->getCountries();
68+
} elseif ($key == "grocrm_timezone") {
69+
$optionArray = $this->grocrm_api->getTimezones();
6170
}
62-
63-
if ($input_type == "select") {
6471

65-
if ($key == "grocrm_country") {
66-
$optionArray = $this->grocrm_api->getCountries();
67-
} elseif ($key == "grocrm_timezone") {
68-
$optionArray = $this->grocrm_api->getTimezones();
69-
}
70-
71-
if (!empty($optionArray)) {
72-
echo "<select id=\"$key\" name=\"$key\">";
73-
74-
echo "<option value=\"\">".esc_html__("Select...", "grocrm")."</option>";
75-
76-
foreach ($optionArray as $optionKey => $optionValue) {
77-
echo "<option value=\"$optionKey\" ".selected($value, $optionKey).">$optionValue</option>";
78-
}
79-
80-
echo "</select>";
72+
if (!empty($optionArray)) {
73+
echo "<select id=\"$key\" name=\"$key\">";
74+
75+
echo "<option value=\"\">".esc_html__("Select...", "grocrm")."</option>";
76+
77+
foreach ($optionArray as $optionKey => $optionValue) {
78+
echo "<option value=\"$optionKey\" ".selected($value, $optionKey).">$optionValue</option>";
8179
}
82-
83-
}
84-
85-
if ($input_type == "textarea") {
86-
echo "<textarea type=\"text\" id=\"$key\" name=\"$key\">".esc_textarea($value)."</textarea>";
87-
}
88-
89-
if (isset($this->grocrm_field_errors[$key])) {
90-
echo "<span class=\"grocrm-error\">".$this->grocrm_field_errors[$key]."</span>";
80+
81+
echo "</select>";
9182
}
92-
93-
echo "</div>";
83+
84+
}
85+
86+
if ($input_type == "textarea") {
87+
echo "<textarea type=\"text\" id=\"$key\" name=\"$key\">".esc_textarea($value)."</textarea>";
88+
}
89+
90+
if (isset($this->grocrm_field_errors[$key])) {
91+
echo "<span class=\"grocrm-error\">".$this->grocrm_field_errors[$key]."</span>";
9492
}
93+
94+
echo "</div>";
95+
}
9596
?>
96-
97+
9798
<div class="grocrm_required_footer">* = <?php esc_html_e("required field", "grocrm"); ?></div>
9899

99100
<div class="grocrm-submit">
100-
<?php
101-
102-
$grocrm_submit = get_option("grocrm_submit");
103-
104-
if (isset($grocrm_submit) && !empty($grocrm_submit)) {
105-
echo '<input type="submit" value="'.esc_attr($grocrm_submit).'">';
106-
} else {
107-
echo '<input type="submit" value="'.esc_html__('Submit', 'grocrm').'">';
108-
}
109-
110-
?>
111-
101+
<?php
102+
103+
$grocrm_submit = get_option("grocrm_submit");
104+
105+
if (isset($grocrm_submit) && !empty($grocrm_submit)) {
106+
echo '<input type="submit" value="'.esc_attr($grocrm_submit).'" name="grocrm_submit">';
107+
} else {
108+
echo '<input type="submit" value="'.esc_html__('Submit', 'grocrm').'" name="grocrm_submit">';
109+
}
110+
111+
?>
112112
</div>
113-
</form>
113+
</form>

0 commit comments

Comments
 (0)