Skip to content

Commit

Permalink
Merge branch 'hotfix/1.0.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmilner committed Apr 22, 2020
2 parents a2f3407 + 601d025 commit 5e3aa05
Show file tree
Hide file tree
Showing 9 changed files with 435 additions and 130 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Deploy to WordPress.org
on:
release:
types: [published]
jobs:
tag:
name: New release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: ft-rockpress
49 changes: 32 additions & 17 deletions assets/js/help.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
!function(e,o,n){window.HSCW=o,window.HS=n,n.beacon=n.beacon||{};var t=n.beacon;t.userConfig={},t.readyQueue=[],t.config=function(e){this.userConfig=e},t.ready=function(e){this.readyQueue.push(e)},o.config={docs:{enabled:!1,baseUrl:""},contact:{enabled:!0,formId:"65c982c9-e34c-11e6-8789-0a5fecc78a4d"}};var r=e.getElementsByTagName("script")[0],c=e.createElement("script");c.type="text/javascript",c.async=!0,c.src="https://djtflbt20bdde.cloudfront.net/",r.parentNode.insertBefore(c,r)}(document,window.HSCW||{},window.HS||{});
!(function (e, t, n) {
function a() {
var e = t.getElementsByTagName("script")[0],
n = t.createElement("script");
(n.type = "text/javascript"),
(n.async = !0),
(n.src = "https://beacon-v2.helpscout.net"),
e.parentNode.insertBefore(n, e);
}
if (
((e.Beacon = n = function (t, n, a) {
e.Beacon.readyQueue.push({ method: t, options: n, data: a });
}),
(n.readyQueue = []),
"complete" === t.readyState)
)
return a();
e.attachEvent
? e.attachEvent("onload", a)
: e.addEventListener("load", a, !1);
})(window, document, window.Beacon || function () {});

HS.beacon.config({
modal: false,
color: '#333333',
topics: rockpress_beacon_vars.topics,
instructions: 'Please fill out this form and RockPress Support will get back to you as soon as possible.',
attachment: false,
poweredBy: false,
icon: 'message',
window.Beacon("init", "93088d45-1d39-4102-ae81-1a983a725c2d");

Beacon("prefill", {
name: rockpress_beacon_vars.customer_name,
email: rockpress_beacon_vars.customer_email,
"RockPress Version": rockpress_beacon_vars.rockpress_ver,
"WordPress Version": rockpress_beacon_vars.wp_ver,
"PHP Version": rockpress_beacon_vars.php_ver,
});

HS.beacon.ready(function() {
HS.beacon.identify({
name: rockpress_beacon_vars.customer_name,
email: rockpress_beacon_vars.customer_email,
'RockPress Version' : rockpress_beacon_vars.ccbpress_ver,
'WordPress Version' : rockpress_beacon_vars.wp_ver,
'PHP Version' : rockpress_beacon_vars.php_ver,
});
Beacon("config", {
hideFABLabelOnMobile: true,
enableFabAnimation: false,
});
4 changes: 2 additions & 2 deletions ft-rockpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: RockPress
* Plugin URI: https://rockpresswp.com/
* Description: Display information from Rock RMS on your WordPress site.
* Version: 1.0.13
* Version: 1.0.14
* Author: RockPress <support@rockpresswp.com>
* Author URI: https://rockpresswp.com/
* Text Domain: ft-rockpress
Expand Down Expand Up @@ -66,7 +66,7 @@ class RockPress {
* @var string
* @since 1.0.0
*/
public $version = '1.0.13';
public $version = '1.0.14';

/**
* Main RockPress Instance
Expand Down
6 changes: 3 additions & 3 deletions includes/admin/admin-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ private function welcome_content() {
<p class="lead-description"><?php esc_html_e( 'We have widgets to display a variety of information.', 'ft-rockpress' ); ?></p>
</div>
</div>
<div class="feature-section two-col">
<div class="col">
<div class="feature-section has-2-columns">
<div class="column">
<h3><?php esc_html_e( 'Service Times Widget', 'ft-rockpress' ); ?></h3>
<img src="<?php echo esc_attr( ROCKPRESS_PLUGIN_URL ) . '/assets/images/widget-service-times.png'; ?>" />
<p><?php esc_html_e( 'Display service times for the selected Campus, straight from Rock RMS.', 'ft-rockpress' ); ?></p>
</div>
<div class="col">
<div class="column">
<h3><?php esc_html_e( 'Campus Selector Widget', 'ft-rockpress' ); ?></h3>
<img src="<?php echo esc_attr( ROCKPRESS_PLUGIN_URL ) . '/assets/images/widget-campus-selector.png'; ?>" />
<p><?php esc_html_e( 'Display links to each campus that is setup in Rock RMS.', 'ft-rockpress' ); ?></p>
Expand Down
16 changes: 1 addition & 15 deletions includes/admin/admin-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,9 @@ private function localize() {
wp_localize_script( 'rockpress-beacon', 'rockpress_beacon_vars', array(
'customer_name' => $current_user->display_name,
'customer_email' => $current_user->user_email,
'ccbpress_ver' => RockPress()->version,
'rockpress_ver' => RockPress()->version,
'wp_ver' => get_bloginfo( 'version' ),
'php_ver' => phpversion(),
'topics' => apply_filters( 'rockpress_support_topics', array(
array(
'val' => 'general',
'label' => __( 'General question', 'ft-rockpress' ),
),
array(
'val' => 'rock-api-key',
'label' => __( 'Rock RMS API Key', 'ft-rockpress' ),
),
array(
'val' => 'bug',
'label' => __( 'I think I found a bug', 'ft-rockpress' ),
),
) ),
) );
}

Expand Down
83 changes: 58 additions & 25 deletions includes/class-rockpress-licenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,14 @@ class RockPress_License {
* @param string $_item_name Item name.
* @param string $_version Version number.
* @param string $_author Author.
* @param string $_item_shortname Item short name / slug.
*/
function __construct( $_file, $_item_id, $_item_name, $_version, $_author ) {
function __construct( $_file, $_item_id, $_item_name, $_version, $_author, $_item_shortname = null ) {

$this->file = $_file;
$this->item_name = $_item_name;
$this->item_id = $_item_id;
$this->item_shortname = 'rockpress_' . $this->item_id;
$this->item_shortname = is_null( $_item_shortname ) ? $this->item_id : $_item_shortname;
$this->version = $_version;
$this->author = $_author;
$this->license = trim( $this->get_license_key() );
Expand Down Expand Up @@ -170,17 +171,31 @@ public function auto_updater() {
return;
}

$edd_updater = new EDD_SL_Plugin_Updater(
$this->api_url,
$this->file,
array(
'version' => $this->version,
'license' => $this->license,
'item_name' => $this->item_name,
'author' => $this->author,
'url' => home_url(),
)
);
if ( is_numeric( $this->item_id ) ) {
new EDD_SL_Plugin_Updater(
$this->api_url,
$this->file,
array(
'version' => $this->version,
'license' => $this->license,
'item_id' => $this->item_id,
'author' => $this->author,
'url' => home_url(),
)
);
} else {
new EDD_SL_Plugin_Updater(
$this->api_url,
$this->file,
array(
'version' => $this->version,
'license' => $this->license,
'item_name' => $this->item_name,
'author' => $this->author,
'url' => home_url(),
)
);
}

}

Expand Down Expand Up @@ -225,12 +240,21 @@ public function activate_license() {
return;
}

$api_params = array(
'edd_action' => 'activate_license',
'license' => $license,
'item_name' => urlencode( $this->item_name ),
'url' => home_url(),
);
if ( is_numeric( $this->item_id ) ) {
$api_params = array(
'edd_action' => 'activate_license',
'license' => $license,
'item_id' => rawurlencode( $this->item_id ),
'url' => home_url(),
);
} else {
$api_params = array(
'edd_action' => 'activate_license',
'license' => $license,
'item_name' => rawurlencode( $this->item_name ),
'url' => home_url(),
);
}

$response = wp_remote_post(
$this->api_url,
Expand Down Expand Up @@ -279,12 +303,21 @@ public function deactivate_license() {

if ( isset( $_POST[ $this->item_shortname . '_license_key_deactivate' ] ) ) {

$api_params = array(
'edd_action' => 'deactivate_license',
'license' => $this->license,
'item_name' => urlencode( $this->item_name ),
'url' => home_url(),
);
if ( is_numeric( $this->item_id ) ) {
$api_params = array(
'edd_action' => 'deactivate_license',
'license' => $this->license,
'item_id' => rawurlencode( $this->item_id ),
'url' => home_url(),
);
} else {
$api_params = array(
'edd_action' => 'deactivate_license',
'license' => $this->license,
'item_name' => rawurlencode( $this->item_name ),
'url' => home_url(),
);
}

$response = wp_remote_post(
$this->api_url,
Expand Down
3 changes: 3 additions & 0 deletions includes/class-rockpress-transients.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ public function cleanup() {
}
}

// Flush the object cache.
wp_cache_flush();

return true;

}
Expand Down
Loading

0 comments on commit 5e3aa05

Please sign in to comment.