npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@calderajs/caldera-mailchimp

v0.5.1

Published

## Install

Downloads

4

Readme

Install

Requires

  • Composer
  • Yarn
  • git
  • Node.js
  • PHP 7.2+

Install for development

  • git clone ...
  • cd caldera-mailchimp
  • bash install.sh

Usage

WordPress Plugin

  • Filter which fields/ interest groups are shown
add_filter('calderawp/Mailchimp/fieldsToHide', function ($fieldsToHide) {
        $fields =  [
            "FNAME" => false,
            "LNAME" => true,
            "ADDRESS" => true,
            "BIRTHDAY" => true,
            "WEBSITE" => false,
            "TIER" => true,
            "a9c6b55e31" => true,
            "0bba7d9ced" => true,
            "17d4a7a745" => false,
            "5891abdae4" => false
        ];

        return array_filter($fields, function($value){
            return (bool) $value;
        });
    });

JavaScript Client

In React App

  • Install
    • yarn add @calderajs/caldera-mailchimp

Without Import

    <script src="https://cdn.jsdelivr.net/gh/Shelob9/mailchimp-plugin/front.js"></script>
    <script>
        window.CALDERA_MAILCHIMP = {
                'apiRoot': 'https://formcalderas.lndo.site/wp-json/caldera-api/v1/messages/mailchimp/'
            }
    </script>
    

Development

Code Locations

PHP code should be in the directory php and follow the PSR-4 Standard for class, filename and directory naming, because we are using the composer autoloader.

JavaScript should go in src.

PHP Testing

Tests uses phpunit as the test runner, as well as for assertions and Mockery for mocking.

  • Run all php tests
    • composer tests
  • Unit tests are located in /tests/Unit
  • Run unit tests
    • composer test:unit
  • Integration tests are located in /tests/Integration
  • Run integration tests
    • composer test:integration
  • Run acceptance tests
    • composer test:acceptance
  • Fix deviations from code style (PSR-1/2 with tabs)
    • composer fixes

JavaScript Development

  • Start webpack development server
    • yarn start

WordPress will automatically detect and load the script from the dev server based on the presence of the asset-manifest.json the dev server outputs into the build directory. Hot reloading is only provided while the dev server is running.

You likely will see errors in the console caused by being unable to connect to webpack dev server. You need to visit the dev server in the browser and instruct it to trust the self-signed certificate.

JavaScript Tests

  • Start webpack development server
    • yarn start
    • WordPress will automatically detect and load the script from the dev server based on the presence of the asset-manifest.json the dev server outputs into the build directory. Hot reloading is only provided while the dev server is running.
  • Build for production
    • yarn build
  • Run Jest test watcher
    • yarn test
  • Start storybook
    • yarn storybook

Build For Release

  • Create WordPress plugin:
    • yarn zip
  • Generate client for non-WordPress sites
    • yarn client:create

License

This plugin is free software, licensed under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. Please share with your neighbors.