Skip to content

Commit

Permalink
Merge pull request #4 from brainstormforce/version-1.0.1
Browse files Browse the repository at this point in the history
Version 1.0.1
  • Loading branch information
Nikschavan authored Jun 6, 2019
2 parents e5d5366 + 65f3aab commit 0f56299
Show file tree
Hide file tree
Showing 7 changed files with 2,009 additions and 10 deletions.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ignore PHPStorm extra directories
.idea/

# OS specific files
.DS_Store

# Leave node_modules from git
node_modules/

# sass cache
.sass-cache

# ignore PHPCS report files
phpcs-summary.log
phpcs-full.log

# Org Package
*.zip

# Ignore Composer's directories
vendor/
53 changes: 53 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
module.exports = function( grunt ) {

'use strict';
var banner = '/**\n * <%= pkg.homepage %>\n * Copyright (c) <%= grunt.template.today("yyyy") %>\n * This file is generated automatically. Do not edit.\n */\n';
// Project configuration
grunt.initConfig( {

pkg: grunt.file.readJSON( 'package.json' ),

addtextdomain: {
options: {
textdomain: 'contacts-in-mautic',
},
target: {
files: {
src: [ '*.php', '**/*.php', '!node_modules/**', '!php-tests/**', '!bin/**' ]
}
}
},

wp_readme_to_markdown: {
your_target: {
files: {
'README.md': 'readme.txt'
}
},
},

makepot: {
target: {
options: {
domainPath: '/languages',
mainFile: 'contacts-in-mautic.php',
potFilename: 'contacts-in-mautic.pot',
potHeaders: {
poedit: true,
'x-poedit-keywordslist': true
},
type: 'wp-plugin',
updateTimestamp: true
}
}
},
} );

grunt.loadNpmTasks( 'grunt-wp-i18n' );
grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' );
grunt.registerTask( 'i18n', ['addtextdomain', 'makepot'] );
grunt.registerTask( 'readme', ['wp_readme_to_markdown'] );

grunt.util.linefeed = '\n';

};
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# Contacts in Mautic
# Contacts in Mautic #
**Contributors:** [brainstormforce](https://profiles.wordpress.org/brainstormforce)
**Tags:** mautic, contacts, api, count, email
**Requires at least:** 4.1
**Stable tag:** 1.0.1
**Tested up to:** 5.2

Display your Mautic Contacts count on your website

## Description ##
A very useful plugin to display your mautic contacts count on your website. This plugin generate the shortcode [mauticcount]. Use this shortocde in your website & share your happy :) customer count with visitors. If you want to include anonymous contacts in count use shortcode `[mauticcount anonymous="on"]`.

# Configurations

- You need to basic configurations at WordPress Dashboard -> Settings -> Mautic Contacts Count Page
- Go to WordPress Dashboard -> Settings -> Mautic Contacts Count Page
- Enter Mautic Base URL
- Enter Public Key and Secret Key

Expand All @@ -18,6 +26,16 @@ A very useful plugin to display your mautic contacts count on your website. This

`[mauticcount anonymous="on"]`

# How To Get Mautic API Credentials
## Changelog ##

# Version 1.0.1
- Improvement: Change the Cron to update contacts count to be executed every week rather than every day, making fewer requests to Mautic
- Fix: Add correct comma separate formatting for the contacts count.

# Version 1.0.0
- Initial Release.

## Installation ##
# How To Get Mautic API Credentials

Need help to get Mautic API credentials? Refer [this doc](https://docs.brainstormforce.com/how-to-get-mautic-api-credentials/) to know How to get mautic credentials.
Need help to get Mautic API credentials? Refer [this doc](https://docs.brainstormforce.com/how-to-get-mautic-api-credentials/) to know How to get mautic credentials.
8 changes: 4 additions & 4 deletions contacts-in-mautic.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Contacts in Mautic
* Plugin URI: http://brainstormforce.com
* Description: Get All Mautic Contacts Count using simple shortcode.
* Version: 1.0.0
* Version: 1.0.1
* Author: Brainstormforce
* Author URI: http://brainstormforce.com
* License: GNU General Public License v2.0
Expand Down Expand Up @@ -65,7 +65,7 @@ function bsf_mautic_cnt_scode( $bsf_atts ) {
$mautic_count_trans = get_transient( 'bsf_mautic_contact_count' );

if ( $mautic_count_trans ) {
return $mautic_count_trans;
return number_format( $mautic_count_trans );
}

$method = "GET";
Expand Down Expand Up @@ -127,8 +127,8 @@ function bsf_mautic_cnt_scode( $bsf_atts ) {
}

if ( isset( $contacts_details->total ) ) {
set_transient( 'bsf_mautic_contact_count', $contacts_details->total, DAY_IN_SECONDS );
return $contacts_details->total;
set_transient( 'bsf_mautic_contact_count', $contacts_details->total, WEEK_IN_SECONDS );
return number_format( $contacts_details->total );
} else {

return _e( 'Something is wrong with mautic authentication. Please authenticate Mautic.', 'contacts-in-mautic' );
Expand Down
Loading

0 comments on commit 0f56299

Please sign in to comment.